# HG changeset patch # User Sebastien Jodogne # Date 1531747235 -7200 # Node ID 2fb9cd42af14396039cc6e615adf88f9c8bebc46 # Parent c0cb5d2cd6960763e6e9761b1d325f8970752fd0 cppcheck diff -r c0cb5d2cd696 -r 2fb9cd42af14 Framework/Common/DatabaseManager.cpp --- a/Framework/Common/DatabaseManager.cpp Mon Jul 16 14:48:43 2018 +0200 +++ b/Framework/Common/DatabaseManager.cpp Mon Jul 16 15:20:35 2018 +0200 @@ -364,8 +364,8 @@ DatabaseManager::CachedStatement::CachedStatement(const StatementLocation& location, Transaction& transaction, const char* sql) : + manager_(transaction.GetManager()), lock_(manager_.mutex_), - manager_(transaction.GetManager()), database_(manager_.GetDatabase()), location_(location), transaction_(manager_.GetTransaction()) diff -r c0cb5d2cd696 -r 2fb9cd42af14 Framework/Common/DatabaseManager.h --- a/Framework/Common/DatabaseManager.h Mon Jul 16 14:48:43 2018 +0200 +++ b/Framework/Common/DatabaseManager.h Mon Jul 16 15:20:35 2018 +0200 @@ -57,7 +57,7 @@ void ReleaseImplicitTransaction(); public: - DatabaseManager(IDatabaseFactory* factory); // Takes ownership + explicit DatabaseManager(IDatabaseFactory* factory); // Takes ownership ~DatabaseManager() { @@ -93,7 +93,7 @@ bool committed_; public: - Transaction(DatabaseManager& manager); + explicit Transaction(DatabaseManager& manager); ~Transaction(); @@ -114,8 +114,8 @@ class CachedStatement : public boost::noncopyable { private: + DatabaseManager& manager_; boost::recursive_mutex::scoped_lock lock_; - DatabaseManager& manager_; IDatabase& database_; StatementLocation location_; ITransaction& transaction_; diff -r c0cb5d2cd696 -r 2fb9cd42af14 Framework/Common/FileValue.h --- a/Framework/Common/FileValue.h Mon Jul 16 14:48:43 2018 +0200 +++ b/Framework/Common/FileValue.h Mon Jul 16 15:20:35 2018 +0200 @@ -35,7 +35,7 @@ { } - FileValue(const std::string& content) : + explicit FileValue(const std::string& content) : content_(content) { } diff -r c0cb5d2cd696 -r 2fb9cd42af14 Framework/Common/GenericFormatter.h --- a/Framework/Common/GenericFormatter.h Mon Jul 16 14:48:43 2018 +0200 +++ b/Framework/Common/GenericFormatter.h Mon Jul 16 15:20:35 2018 +0200 @@ -33,7 +33,7 @@ std::vector parametersType_; public: - GenericFormatter(Dialect dialect) : + explicit GenericFormatter(Dialect dialect) : dialect_(dialect) { } diff -r c0cb5d2cd696 -r 2fb9cd42af14 Framework/Common/Query.h --- a/Framework/Common/Query.h Mon Jul 16 14:48:43 2018 +0200 +++ b/Framework/Common/Query.h Mon Jul 16 15:20:35 2018 +0200 @@ -58,7 +58,7 @@ void Setup(const std::string& sql); public: - Query(const std::string& sql); + explicit Query(const std::string& sql); Query(const std::string& sql, bool isReadOnly); diff -r c0cb5d2cd696 -r 2fb9cd42af14 Framework/PostgreSQL/PostgreSQLDatabase.cpp --- a/Framework/PostgreSQL/PostgreSQLDatabase.cpp Mon Jul 16 14:48:43 2018 +0200 +++ b/Framework/PostgreSQL/PostgreSQLDatabase.cpp Mon Jul 16 15:20:35 2018 +0200 @@ -104,8 +104,9 @@ { PostgreSQLTransaction transaction(*this); - PostgreSQLStatement s(*this, "select pg_try_advisory_lock(" + - boost::lexical_cast(lock) + ");"); + Query query("select pg_try_advisory_lock(" + + boost::lexical_cast(lock) + ");", false); + PostgreSQLStatement s(*this, query); PostgreSQLResult result(s); if (result.IsDone() || diff -r c0cb5d2cd696 -r 2fb9cd42af14 PostgreSQL/NEWS --- a/PostgreSQL/NEWS Mon Jul 16 14:48:43 2018 +0200 +++ b/PostgreSQL/NEWS Mon Jul 16 15:20:35 2018 +0200 @@ -1,12 +1,13 @@ Pending changes in the mainline =============================== -Important remark when upgrading from an older version of the Plugin: -* The plugin will create a new index to improve search performances. - This can take several minutes at Orthanc startup. Orthanc will not - be available during this period. - On a 100000 studies DB, we've observed that the creation of this index - took around 10 minutes. +!! Important remark when upgrading from an older version of the plugin: + + The plugin will create a new index to improve search performance. + This can take several minutes at the first Orthanc startup. Orthanc + will not be available during this period. On a PostgreSQL database + with 100,000 studies, we have observed that updating the index took + around 10 minutes. * Migration into the "orthanc-databases" repository * Full refactoring to share code with MySQL