diff --git a/src/cpp/model/table/ModelBase.h b/src/cpp/model/table/ModelBase.h index 917e8dd62..11f272166 100644 --- a/src/cpp/model/table/ModelBase.h +++ b/src/cpp/model/table/ModelBase.h @@ -96,7 +96,8 @@ namespace model { bool ModelBase::isExistInDB(const std::string& fieldName, const T& fieldValue) { auto cm = ConnectionManager::getInstance(); - Poco::Data::Statement select(cm->getConnection(CONNECTION_MYSQL_LOGIN_SERVER)); + auto session = cm->getConnection(CONNECTION_MYSQL_LOGIN_SERVER); + Poco::Data::Statement select(session); int id; select << "SELECT " << "id " << " FROM " << getTableName()