Skip to content
Snippets Groups Projects
Commit c0786b1d authored by Marco De Marco's avatar Marco De Marco
Browse files

Mysql server is gone away fix

parent 10536f19
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,8 @@
#include <soci/mysql/soci-mysql.h>
#include <soci/use.h>
#include <mysql.h>
namespace MetadataExporter_ns
{
......@@ -62,7 +64,18 @@ void DBManager::connect() throw(soci::soci_error)
#endif
for(unsigned int i=0; i<connectionNumber; ++i)
{
m_connectionPool_sp->at(i).open(soci::mysql, connection.str());
soci::mysql_session_backend* backend =
static_cast<soci::mysql_session_backend*>(
m_connectionPool_sp->at(i).get_backend());
MYSQL* mysql = backend->conn_;
bool reconnect = true;
mysql_options(mysql, MYSQL_OPT_RECONNECT, &reconnect);
}
}
//==============================================================================
......
......@@ -30,7 +30,7 @@ Server::Server(Tango::DeviceImpl* deviceImpl_p, Configuration::SP configuration_
}
//==============================================================================
// Server::Server()
// Server::~Server()
//==============================================================================
Server::~Server()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment