diff --git a/MySQL/MySQLClientImpl.cpp b/MySQL/MySQLClientImpl.cpp index d045e1d..381c61e 100644 --- a/MySQL/MySQLClientImpl.cpp +++ b/MySQL/MySQLClientImpl.cpp @@ -72,9 +72,21 @@ 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