changeset 382:97f12bcd1826 db-protobuf

implemented finalize_transaction()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 31 Mar 2023 17:28:44 +0200
parents 9cde77ca9ad9
children bed7615c2484
files Framework/Plugins/DatabaseBackendAdapterV4.cpp
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Plugins/DatabaseBackendAdapterV4.cpp	Thu Mar 30 21:16:57 2023 +0200
+++ b/Framework/Plugins/DatabaseBackendAdapterV4.cpp	Fri Mar 31 17:28:44 2023 +0200
@@ -459,6 +459,22 @@
         break;
       }
               
+      case Orthanc::DatabasePluginMessages::OPERATION_FINALIZE_TRANSACTION:
+      {
+        IndexConnectionsPool::Accessor* transaction = reinterpret_cast<IndexConnectionsPool::Accessor*>(request.finalize_transaction().transaction());
+        
+        if (transaction == NULL)
+        {
+          throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
+        }
+        else
+        {
+          delete transaction;
+        }
+        
+        break;
+      }
+              
       default:
         LOG(ERROR) << "Not implemented database operation from protobuf: " << request.operation();
         throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);