Mercurial > hg > orthanc-databases
comparison Framework/Common/DatabaseManager.cpp @ 215:b40b30075c51
added TransactionType_Implicit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 26 Mar 2021 17:32:29 +0100 |
parents | d9ef3f16e6a2 |
children | 90eb271f85b2 |
comparison
equal
deleted
inserted
replaced
214:ab96698c73a3 | 215:b40b30075c51 |
---|---|
163 { | 163 { |
164 LOG(TRACE) << "Automatically creating an implicit database transaction"; | 164 LOG(TRACE) << "Automatically creating an implicit database transaction"; |
165 | 165 |
166 try | 166 try |
167 { | 167 { |
168 transaction_.reset(GetDatabase().CreateTransaction(true)); | 168 transaction_.reset(GetDatabase().CreateTransaction(TransactionType_Implicit)); |
169 } | 169 } |
170 catch (Orthanc::OrthancException& e) | 170 catch (Orthanc::OrthancException& e) |
171 { | 171 { |
172 CloseIfUnavailable(e.GetErrorCode()); | 172 CloseIfUnavailable(e.GetErrorCode()); |
173 throw; | 173 throw; |
224 { | 224 { |
225 LOG(ERROR) << "Cannot start another transaction while there is an uncommitted transaction"; | 225 LOG(ERROR) << "Cannot start another transaction while there is an uncommitted transaction"; |
226 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database); | 226 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database); |
227 } | 227 } |
228 | 228 |
229 transaction_.reset(GetDatabase().CreateTransaction(false)); | 229 transaction_.reset(GetDatabase().CreateTransaction(type)); |
230 } | 230 } |
231 catch (Orthanc::OrthancException& e) | 231 catch (Orthanc::OrthancException& e) |
232 { | 232 { |
233 CloseIfUnavailable(e.GetErrorCode()); | 233 CloseIfUnavailable(e.GetErrorCode()); |
234 throw; | 234 throw; |