changeset 18:c7c54993a92e

fix sqlite
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Jul 2018 10:40:39 +0200
parents 54ea251aed70
children aacb651833f5
files Framework/Common/DatabaseManager.cpp Framework/Common/DatabaseManager.h
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Common/DatabaseManager.cpp	Tue Jul 10 10:33:02 2018 +0200
+++ b/Framework/Common/DatabaseManager.cpp	Tue Jul 10 10:40:39 2018 +0200
@@ -307,8 +307,9 @@
                                                     const char* sql) :
     lock_(manager.mutex_),
     manager_(manager),
+    database_(manager_.GetDatabase()),
     location_(location),
-    transaction_(manager.GetTransaction())
+    transaction_(manager_.GetTransaction())
   {
     Setup(sql);
   }
@@ -319,6 +320,7 @@
                                                     const char* sql) :
     lock_(manager_.mutex_),
     manager_(transaction.GetManager()),
+    database_(manager_.GetDatabase()),
     location_(location),
     transaction_(manager_.GetTransaction())
   {
--- a/Framework/Common/DatabaseManager.h	Tue Jul 10 10:33:02 2018 +0200
+++ b/Framework/Common/DatabaseManager.h	Tue Jul 10 10:40:39 2018 +0200
@@ -123,6 +123,7 @@
     private:
       boost::recursive_mutex::scoped_lock  lock_;
       DatabaseManager&                     manager_;
+      IDatabase&                           database_;
       StatementLocation                    location_;
       ITransaction&                        transaction_;
       IPrecompiledStatement*               statement_;
@@ -142,6 +143,11 @@
                       Transaction& transaction,
                       const char* sql);
 
+      IDatabase& GetDatabase()
+      {
+        return database_;
+      }
+
       void SetReadOnly(bool readOnly);
 
       void SetParameterType(const std::string& parameter,