comparison Framework/Common/DatabaseManager.cpp @ 297:86265ef5f3e3

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Jul 2021 11:31:16 +0200
parents 29d2b76516f6
children 87f0e29a1dc1
comparison
equal deleted inserted replaced
296:024ec14b9121 297:86265ef5f3e3
22 #include "DatabaseManager.h" 22 #include "DatabaseManager.h"
23 23
24 #include "Integer64Value.h" 24 #include "Integer64Value.h"
25 #include "BinaryStringValue.h" 25 #include "BinaryStringValue.h"
26 #include "Utf8StringValue.h" 26 #include "Utf8StringValue.h"
27 #include "../../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
28 27
29 #include <Compatibility.h> // For std::unique_ptr<> 28 #include <Compatibility.h> // For std::unique_ptr<>
30 #include <Logging.h> 29 #include <Logging.h>
31 #include <OrthancException.h> 30 #include <OrthancException.h>
32 31
59 } 58 }
60 59
61 60
62 void DatabaseManager::CloseIfUnavailable(Orthanc::ErrorCode e) 61 void DatabaseManager::CloseIfUnavailable(Orthanc::ErrorCode e)
63 { 62 {
64 bool failure; 63 if (e != Orthanc::ErrorCode_Success &&
65 64 e != Orthanc::ErrorCode_DatabaseCannotSerialize)
66 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 2)
67 failure = (e != Orthanc::ErrorCode_Success &&
68 e != Orthanc::ErrorCode_DatabaseCannotSerialize);
69 #else
70 failure = (e != Orthanc::ErrorCode_Success);
71 #endif
72
73 if (failure)
74 { 65 {
75 transaction_.reset(NULL); 66 transaction_.reset(NULL);
76 } 67 }
77 68
78 if (e == Orthanc::ErrorCode_DatabaseUnavailable) 69 if (e == Orthanc::ErrorCode_DatabaseUnavailable)