Would a connection pool help here?
-----Original Message-----
From: Jim Wallace [mailto:jwallace@stripped]
Sent: Thursday, August 06, 2009 10:39 AM
Cc: plusplus@stripped
Subject: RE: Automatic Reconnect
or this is how I do it.
http://lists.mysql.com/plusplus/6624
-----Original Message-----
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
http://lists.mysql.com/plusplus/8517
On Thu, Aug 6, 2009 at 10:30 AM, Nishant Mittal <NMittal@stripped>
wrote:
> 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
>
>
>
>
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsub=1