From 939e942ba8a97f13926fc9c2372dbfcee7972f4e Mon Sep 17 00:00:00 2001 From: Dario Date: Mon, 24 Aug 2020 15:59:56 +0200 Subject: [PATCH] Enable again auto reconnect, own solution not working --- src/cpp/SingletonManager/ConnectionManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpp/SingletonManager/ConnectionManager.cpp b/src/cpp/SingletonManager/ConnectionManager.cpp index a86f41f60..031cd973f 100644 --- a/src/cpp/SingletonManager/ConnectionManager.cpp +++ b/src/cpp/SingletonManager/ConnectionManager.cpp @@ -56,7 +56,7 @@ bool ConnectionManager::setConnectionsFromConfig(const Poco::Util::LayeredConfig dbConfig << "db=" << dbName << ";"; dbConfig << "user=" << config.getString(firstKeyPart + ".db.user", "root") << ";"; dbConfig << "password=" << config.getString(firstKeyPart + ".db.password", "") << ";"; - dbConfig << "auto-reconnect=false"; + dbConfig << "auto-reconnect=true"; setConnection(dbConfig.str(), type); @@ -73,7 +73,7 @@ Poco::Data::Session ConnectionManager::getConnection(ConnectionType type) throw Poco::NotFoundException("Connection Type unknown", std::to_string(type)); } auto session = mSessionPools.getPool(mSessionPoolNames[type]).get(); - if (!session.isConnected()) { + /*if (!session.isConnected()) { printf("reconnect called\n"); try { session.reconnect(); @@ -83,7 +83,7 @@ Poco::Data::Session ConnectionManager::getConnection(ConnectionType type) sendErrorsAsEmail(); return mSessionPools.getPool(mSessionPoolNames[type]).get(); } - } + }*/ //std::string dateTimeString = Poco::DateTimeFormatter::format(Poco::DateTime(), "%d.%m.%y %H:%M:%S"); //printf("[getConnection] %s impl: %p\n", dateTimeString.data(), session.impl()); return session;