diff OrthancServer/ServerIndex.cpp @ 1235:9b4977e3c19d

abstraction
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Dec 2014 14:31:46 +0100
parents efece308018e
children 21d84e3acc0d
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp	Fri Dec 05 11:11:58 2014 +0100
+++ b/OrthancServer/ServerIndex.cpp	Fri Dec 05 14:31:46 2014 +0100
@@ -43,7 +43,6 @@
 #include "../Core/Toolbox.h"
 #include "../Core/Uuid.h"
 #include "../Core/DicomFormat/DicomArray.h"
-#include "../Core/SQLite/Transaction.h"
 #include "FromDcmtkBridge.h"
 #include "ServerContext.h"
 
@@ -214,7 +213,7 @@
   {
   private:
     ServerIndex& index_;
-    std::auto_ptr<SQLite::Transaction> transaction_;
+    std::auto_ptr<SQLite::ITransaction> transaction_;
     bool isCommitted_;
 
   public:
@@ -1059,7 +1058,7 @@
       }
     }
 
-    // No need for a SQLite::Transaction here, as we only insert 1 record
+    // No need for a SQLite::ITransaction here, as we only insert 1 record
     db_->LogExportedResource(type,
                              publicId,
                              remoteModality,
@@ -1233,7 +1232,7 @@
       throw OrthancException(ErrorCode_ParameterOutOfRange);
     }
 
-    // No need for a SQLite::Transaction here, as we only make 1 write to the DB
+    // No need for a SQLite::ITransaction here, as we only make 1 write to the DB
     db_->SetProtectedPatient(id, isProtected);
 
     if (isProtected)
@@ -1437,7 +1436,7 @@
   {
     boost::mutex::scoped_lock lock(mutex_);
 
-    std::auto_ptr<SQLite::Transaction> transaction(db_->StartTransaction());
+    std::auto_ptr<SQLite::ITransaction> transaction(db_->StartTransaction());
 
     transaction->Begin();
     uint64_t seq = db_->IncrementGlobalSequence(sequence);
@@ -1452,7 +1451,7 @@
                               const std::string& publicId)
   {
     boost::mutex::scoped_lock lock(mutex_);
-    std::auto_ptr<SQLite::Transaction> transaction(db_->StartTransaction());
+    std::auto_ptr<SQLite::ITransaction> transaction(db_->StartTransaction());
     transaction->Begin();
 
     int64_t id;