changeset 3315:8bf33fa68435

Fix missing DB transactions in some write operations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 28 Feb 2019 18:09:36 +0100
parents 7eb5405b7ed8
children 4b1017928fc4
files NEWS OrthancServer/ServerIndex.cpp
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Feb 28 09:29:48 2019 +0100
+++ b/NEWS	Thu Feb 28 18:09:36 2019 +0100
@@ -13,6 +13,7 @@
 -----------
 
 * Enlarge the support of JSON-to-XML conversion in the REST API
+* Fix missing DB transactions in some write operations
 
 
 Version 1.5.5 (2019-02-25)
--- a/OrthancServer/ServerIndex.cpp	Thu Feb 28 09:29:48 2019 +0100
+++ b/OrthancServer/ServerIndex.cpp	Thu Feb 28 18:09:36 2019 +0100
@@ -1935,13 +1935,19 @@
   void ServerIndex::DeleteChanges()
   {
     boost::mutex::scoped_lock lock(mutex_);
+
+    Transaction transaction(*this);
     db_.ClearChanges();
+    transaction.Commit(0);
   }
 
   void ServerIndex::DeleteExportedResources()
   {
     boost::mutex::scoped_lock lock(mutex_);
+
+    Transaction transaction(*this);
     db_.ClearExportedResources();
+    transaction.Commit(0);
   }
 
 
@@ -2235,7 +2241,10 @@
                                       const std::string& value)
   {
     boost::mutex::scoped_lock lock(mutex_);
+
+    Transaction transaction(*this);
     db_.SetGlobalProperty(property, value);
+    transaction.Commit(0);
   }