mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add reporting for mysql connections, to find error with mysql querys
This commit is contained in:
parent
52b836a235
commit
d6a0b15720
@ -37,18 +37,15 @@ public:
|
||||
|
||||
inline Poco::Data::Session getConnection(ConnectionType type) {
|
||||
Poco::ScopedLock<Poco::FastMutex> _lock(mWorkingMutex);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CONNECTION_MYSQL_LOGIN_SERVER:
|
||||
case CONNECTION_MYSQL_PHP_SERVER:
|
||||
return mSessionPools.getPool(mSessionPoolNames[type]).get();
|
||||
default:
|
||||
|
||||
if (CONNECTION_MYSQL_LOGIN_SERVER != type && CONNECTION_MYSQL_PHP_SERVER != type) {
|
||||
addError(new ParamError("[ConnectionManager::getConnection]", "Connection Type unknown", std::to_string(type)));
|
||||
break;
|
||||
throw Poco::NotFoundException("Connection Type unknown", std::to_string(type));
|
||||
}
|
||||
throw Poco::NotFoundException("Connection Type unknown", std::to_string(type));
|
||||
//return Poco::Data::Session(nullptr);
|
||||
auto session = 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;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user