Mercurial > hg > orthanc-databases
comparison 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 |
comparison
equal
deleted
inserted
replaced
233:7d46c99523a2 | 234:d1b124d116c1 |
---|---|
56 } | 56 } |
57 | 57 |
58 | 58 |
59 void DatabaseManager::CloseIfUnavailable(Orthanc::ErrorCode e) | 59 void DatabaseManager::CloseIfUnavailable(Orthanc::ErrorCode e) |
60 { | 60 { |
61 if (e != Orthanc::ErrorCode_Success) | 61 if (e != Orthanc::ErrorCode_Success && |
62 e != Orthanc::ErrorCode_DatabaseCannotSerialize) | |
62 { | 63 { |
63 transaction_.reset(NULL); | 64 transaction_.reset(NULL); |
64 } | 65 } |
65 | 66 |
66 if (e == Orthanc::ErrorCode_DatabaseUnavailable) | 67 if (e == Orthanc::ErrorCode_DatabaseUnavailable) |
207 | 208 |
208 void DatabaseManager::RollbackTransaction() | 209 void DatabaseManager::RollbackTransaction() |
209 { | 210 { |
210 if (transaction_.get() == NULL) | 211 if (transaction_.get() == NULL) |
211 { | 212 { |
212 LOG(ERROR) << "Cannot rollback a non-existing transaction"; | 213 LOG(INFO) << "Cannot rollback a non-existing transaction"; |
213 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | 214 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); |
214 } | 215 } |
215 else | 216 else |
216 { | 217 { |
217 try | 218 try |