List:MySQL++« Previous MessageNext Message »
From:Nishant Mittal Date:August 6 2009 5:52pm
Subject:RE: Automatic Reconnect
View as plain text  
Thanks Chris, I appreciate it.



Nishant Mittal

Rosenblatt Securities Inc.

nmittal@stripped <mailto:nmittal@stripped> 


From: Chris Morgan [mailto:christopher.j.morgan@stripped] 
Sent: Thursday, August 06, 2009 1:36 PM
To: Nishant Mittal
Cc: plusplus@stripped
Subject: Re: Automatic Reconnect

On Thu, Aug 6, 2009 at 10:30 AM, Nishant Mittal <NMittal@stripped>

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

//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.



Nishant Mittal


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