List:MySQL++« Previous MessageNext Message »
From:Nishant Mittal Date:August 6 2009 5:30pm
Subject:Automatic Reconnect
View as plain text  
Hi, I have a program that has to run round the clock. Its written in C++
and uses the MySQL++ lib to connect to a MySQL server. 

The problem I have been having is with the mysql servers default timeout
limit of 8hrs. After that my program keeps getting a "MySQL has gone
away" error.

I can solve this by changing the server settings so it never timeouts
but I do not want to do that.

the other solution is to ask the lib to automatically reconnect when the
above happens. I have done some reading but so far have not been
successful.



//I have tried the following on the connection object with no help...
 
mysqlpp::Connection dbc_ticker_add;
dbc_ticker_add.connect(sDBName.c_str(), sDBServer.c_str(),
sDBUser.c_str(), sDBPassword.c_str());
dbc_ticker_add.set_option( new mysqlpp::ReconnectOption(true) );


Can someone who has worked with this lib help me out here.

thanks.

 

Thanks,

Nishant Mittal

 


Thread
Automatic ReconnectNishant Mittal6 Aug
  • Re: Automatic ReconnectChris Morgan6 Aug
    • RE: Automatic ReconnectJim Wallace6 Aug
      • RE: Automatic Reconnectdancook)6 Aug
        • Re: Automatic ReconnectWarren Young6 Aug
          • RE: Automatic Reconnectdancook)6 Aug
            • Re: Automatic ReconnectWarren Young6 Aug
    • RE: Automatic ReconnectNishant Mittal6 Aug