diff Framework/SQLite/SQLiteTransaction.cpp @ 214:ab96698c73a3

removed useless information about read-only in ITransaction and IPrecompiledStatement
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Mar 2021 13:56:26 +0100
parents 3236894320d6
children 35598014f140
line wrap: on
line diff
--- a/Framework/SQLite/SQLiteTransaction.cpp	Wed Mar 24 15:59:23 2021 +0100
+++ b/Framework/SQLite/SQLiteTransaction.cpp	Thu Mar 25 13:56:26 2021 +0100
@@ -30,8 +30,7 @@
 namespace OrthancDatabases
 {
   SQLiteTransaction::SQLiteTransaction(SQLiteDatabase& database) :
-    transaction_(database.GetObject()),
-    readOnly_(true)
+    transaction_(database.GetObject())
   {
     transaction_.Begin();
 
@@ -44,24 +43,12 @@
   IResult* SQLiteTransaction::Execute(IPrecompiledStatement& statement,
                                       const Dictionary& parameters)
   {
-    std::unique_ptr<IResult> result(dynamic_cast<SQLiteStatement&>(statement).Execute(*this, parameters));
-
-    if (!statement.IsReadOnly())
-    {
-      readOnly_ = false;
-    }
-    
-    return result.release();
+    return dynamic_cast<SQLiteStatement&>(statement).Execute(*this, parameters);
   }
 
   void SQLiteTransaction::ExecuteWithoutResult(IPrecompiledStatement& statement,
                                                const Dictionary& parameters)
   {
     dynamic_cast<SQLiteStatement&>(statement).ExecuteWithoutResult(*this, parameters);
-
-    if (!statement.IsReadOnly())
-    {
-      readOnly_ = false;
-    }
   }
 }