comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp @ 4819:70d2a97ca8cb openssl-3.x

integration mainline->openssl-3.x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Nov 2021 13:12:32 +0100
parents f0038043fb97 23aeffecb8cb
children 2e71a08eea15
comparison
equal deleted inserted replaced
4785:61da49321754 4819:70d2a97ca8cb
2796 transaction_.SelectPatientToRecycle(patientToRecycle, patientToAvoid) : 2796 transaction_.SelectPatientToRecycle(patientToRecycle, patientToAvoid) :
2797 transaction_.SelectPatientToRecycle(patientToRecycle)); 2797 transaction_.SelectPatientToRecycle(patientToRecycle));
2798 2798
2799 if (!ok) 2799 if (!ok)
2800 { 2800 {
2801 throw OrthancException(ErrorCode_FullStorage); 2801 throw OrthancException(ErrorCode_FullStorage, "Cannot recycle more patients");
2802 } 2802 }
2803 2803
2804 LOG(TRACE) << "Recycling one patient"; 2804 LOG(TRACE) << "Recycling one patient";
2805 transaction_.DeleteResource(patientToRecycle); 2805 transaction_.DeleteResource(patientToRecycle);
2806 2806
3250 } 3250 }
3251 catch (OrthancException& e) 3251 catch (OrthancException& e)
3252 { 3252 {
3253 if (e.GetErrorCode() == ErrorCode_DatabaseCannotSerialize) 3253 if (e.GetErrorCode() == ErrorCode_DatabaseCannotSerialize)
3254 { 3254 {
3255 throw; 3255 throw; // the transaction has failed -> do not commit the current transaction (and retry)
3256 } 3256 }
3257 else 3257 else
3258 { 3258 {
3259 LOG(ERROR) << "EXCEPTION [" << e.What() << "]"; 3259 LOG(ERROR) << "EXCEPTION [" << e.What() << " - " << e.GetDetails() << "]";
3260
3261 if (e.GetErrorCode() == ErrorCode_FullStorage)
3262 {
3263 throw; // do not commit the current transaction
3264 }
3265
3266 // this is an expected failure, exit normaly and commit the current transaction
3260 storeStatus_ = StoreStatus_Failure; 3267 storeStatus_ = StoreStatus_Failure;
3261 } 3268 }
3262 } 3269 }
3263 } 3270 }
3264 }; 3271 };