# HG changeset patch # User Sebastien Jodogne # Date 1617028760 -7200 # Node ID 492aa3edf5727d95607be98b0e01e7a7925ae595 # Parent dd6cfc25074744f106de4c04efb35deff433a133 use read-only, explicit transaction in IndexBackend::GetDatabaseVersion() diff -r dd6cfc250747 -r 492aa3edf572 Framework/Plugins/IndexBackend.cpp --- a/Framework/Plugins/IndexBackend.cpp Mon Mar 29 14:52:55 2021 +0200 +++ b/Framework/Plugins/IndexBackend.cpp Mon Mar 29 16:39:20 2021 +0200 @@ -1439,6 +1439,11 @@ uint32_t IndexBackend::GetDatabaseVersion() { + // Create a read-only, explicit transaction to read the database + // version (this was a read-write, implicit transaction in + // PostgreSQL plugin <= 3.3 and MySQL plugin <= 3.0) + DatabaseManager::Transaction transaction(GetManager(), TransactionType_ReadOnly); + std::string version = "unknown"; if (LookupGlobalProperty(version, Orthanc::GlobalProperty_DatabaseSchemaVersion))