Improve reconnection behavior
This commit is contained in:
@@ -72,10 +72,22 @@ void MySQLClientImpl::Execute(const std::string& query)
|
||||
if (!m_connected)
|
||||
{
|
||||
if (m_automaticReconnect)
|
||||
{
|
||||
InternalConnect();
|
||||
if (!m_connected)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "MySQLClientImpl::Execute() - Error: Reconnect failed" << std::endl;
|
||||
ss << "Query: " << query << std::endl;
|
||||
Logging::Log(Logging::Severity::Error, ss.str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error("MySQLClientImpl::ExecuteQuery() - Not connected to a Database Server");
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user