diff OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp @ 4607:f75c63aa9de0 db-changes

differentiating between shared and private global properties
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Mar 2021 18:10:27 +0200
parents cc64385593ef
children 95ffe3b6ef7c
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Tue Mar 30 16:34:23 2021 +0200
+++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Tue Mar 30 18:10:27 2021 +0200
@@ -827,8 +827,12 @@
 
 
     virtual bool LookupGlobalProperty(std::string& target,
-                                      GlobalProperty property) ORTHANC_OVERRIDE
+                                      GlobalProperty property,
+                                      bool shared) ORTHANC_OVERRIDE
     {
+      // The "shared" info is not used by the SQLite database, as it
+      // can only be used by one Orthanc server.
+      
       SQLite::Statement s(db_, SQLITE_FROM_HERE, 
                           "SELECT value FROM GlobalProperties WHERE property=?");
       s.BindInt(0, property);
@@ -964,8 +968,12 @@
 
 
     virtual void SetGlobalProperty(GlobalProperty property,
+                                   bool shared,
                                    const std::string& value) ORTHANC_OVERRIDE
     {
+      // The "shared" info is not used by the SQLite database, as it
+      // can only be used by one Orthanc server.
+      
       SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT OR REPLACE INTO GlobalProperties VALUES(?, ?)");
       s.BindInt(0, property);
       s.BindString(1, value);
@@ -1318,7 +1326,7 @@
 
       // Check the version of the database
       std::string tmp;
-      if (!transaction->LookupGlobalProperty(tmp, GlobalProperty_DatabaseSchemaVersion))
+      if (!transaction->LookupGlobalProperty(tmp, GlobalProperty_DatabaseSchemaVersion, true /* unused in SQLite */))
       {
         tmp = "Unknown";
       }
@@ -1343,7 +1351,7 @@
       // New in Orthanc 1.5.1
       if (version_ == 6)
       {
-        if (!transaction->LookupGlobalProperty(tmp, GlobalProperty_GetTotalSizeIsFast) ||
+        if (!transaction->LookupGlobalProperty(tmp, GlobalProperty_GetTotalSizeIsFast, true /* unused in SQLite */) ||
             tmp != "1")
         {
           LOG(INFO) << "Installing the SQLite triggers to track the size of the attachments";