diff Framework/Common/DatabaseManager.cpp @ 234:d1b124d116c1

PostgreSQL index plugin handles retries for collisions between multiple writers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 08 Apr 2021 10:50:01 +0200
parents 0a9b48d19643
children f2b32d31fc99
line wrap: on
line diff
--- a/Framework/Common/DatabaseManager.cpp	Tue Apr 06 15:07:27 2021 +0200
+++ b/Framework/Common/DatabaseManager.cpp	Thu Apr 08 10:50:01 2021 +0200
@@ -58,7 +58,8 @@
     
   void DatabaseManager::CloseIfUnavailable(Orthanc::ErrorCode e)
   {
-    if (e != Orthanc::ErrorCode_Success)
+    if (e != Orthanc::ErrorCode_Success &&
+        e != Orthanc::ErrorCode_DatabaseCannotSerialize)
     {
       transaction_.reset(NULL);
     }
@@ -209,7 +210,7 @@
   {
     if (transaction_.get() == NULL)
     {
-      LOG(ERROR) << "Cannot rollback a non-existing transaction";
+      LOG(INFO) << "Cannot rollback a non-existing transaction";
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
     }
     else