add mutex for connection manager, maybe there is where the mysql error are coming from, if two threads call getConnection at the same time

This commit is contained in:
Dario 2020-07-14 21:03:25 +02:00
parent 92de466261
commit 81faa98f21

View File

@ -36,6 +36,8 @@ public:
}
inline Poco::Data::Session getConnection(ConnectionType type) {
Poco::ScopedLock<Poco::FastMutex> _lock(mWorkingMutex);
switch (type)
{
case CONNECTION_MYSQL_LOGIN_SERVER:
@ -55,6 +57,7 @@ protected:
private:
std::string mSessionPoolNames[CONNECTION_MAX];
Poco::Data::SessionPoolContainer mSessionPools;
Poco::FastMutex mWorkingMutex;
};
#endif //GRADIDO_LOGIN_SERVER_SINGLETON_MANAGER_CONNECTION_MANAGER_INCLUDE