dbTalk Databases Forums  

Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY"

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY" in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bryan Seay
 
Posts: n/a

Default Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY" - 09-07-2006 , 10:32 AM






I have a daemon running 24/7 that uses the mysql++ package to connect to my
database. It works great but after it passes the wait_timeout of the server
it, of course, spits out a "MYSQL SERVER HAS GONE AWAY".

My question is what is the correct way to deal with this? Is there some
option I am not seeing that will make the daemon reconnect to the db if it
fails? Or should I put a timer in my code that "pings" the database
occasionally to keep the connection open?

Any ideas are appreciated.

Thanks,
Bryan


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Bruce Keats
 
Posts: n/a

Default RE: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY" - 09-11-2006 , 02:33 PM






We have the same issue so I am also curious what the recommended approach
is.


Bruce


Quote:
From: "Bryan Seay" <bseay (AT) invocon (DOT) com
To: <plusplus (AT) lists (DOT) mysql.com
Subject: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY"
Date: Thu, 7 Sep 2006 10:28:40 -0500
I have a daemon running 24/7 that uses the mysql++ package to connect to my
database. It works great but after it passes the wait_timeout of the
server
it, of course, spits out a "MYSQL SERVER HAS GONE AWAY".

My question is what is the correct way to deal with this? Is there some
option I am not seeing that will make the daemon reconnect to the db if it
fails? Or should I put a timer in my code that "pings" the database
occasionally to keep the connection open?

Any ideas are appreciated.

Thanks,
Bryan




--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Bryan Seay
 
Posts: n/a

Default RE: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY" - 09-11-2006 , 05:32 PM



Think I figured it out.

m_db_conn = new Connection( db_name, host, username, pw, port);
if(m_db_conn->connected())
{
m_db_conn->set_option(Connection::Option:pt_reconnect, true);
}




Quote:
We have the same issue so I am also curious what the recommended approach
is.


Bruce


From: "Bryan Seay" <bseay@stripped
To: <plusplus@stripped
Subject: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY"
Date: Thu, 7 Sep 2006 10:28:40 -0500
I have a daemon running 24/7 that uses the mysql++ package to connect to my
database. It works great but after it passes the wait_timeout of the
server
it, of course, spits out a "MYSQL SERVER HAS GONE AWAY".

My question is what is the correct way to deal with this? Is there some
option I am not seeing that will make the daemon reconnect to the db if it
fails? Or should I put a timer in my code that "pings" the database
occasionally to keep the connection open?

Any ideas are appreciated.

Thanks,
Bryan




--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Julien Chavanton
 
Posts: n/a

Default RE: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY" - 09-20-2006 , 01:03 PM



------_=_NextPart_001_01C6DCBC.A12ECB9E
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=20
=20
=20
Quote:
Think I figured it out.=20
=20
m_db_conn =3D new Connection( db_name, host, username, pw, port);
if(m_db_conn->connected())
{
m_db_conn->set_option(Connection::Option:pt_reconnect, true);
}
=20
This is interesting however; it seems like this solution uses an
abstraction of Mysql++ API?
Can you provide the equivalent C API function call to Mysql++
=20
=20
=20
=20
=20
Quote:
We have the same issue so I am also curious what the recommended
approach=20
is.
=20
=20
Bruce
=20
=20
From: "Bryan Seay" <bseay@stripped
To: <plusplus@stripped
Subject: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE
AWAY"
Date: Thu, 7 Sep 2006 10:28:40 -0500
I have a daemon running 24/7 that uses the mysql++ package to connect
to my
database. It works great but after it passes the wait_timeout of the=20
server
it, of course, spits out a "MYSQL SERVER HAS GONE AWAY".
=20
My question is what is the correct way to deal with this? Is there
some
option I am not seeing that will make the daemon reconnect to the db
if it
fails? Or should I put a timer in my code that "pings" the database
occasionally to keep the connection open?
=20
Any ideas are appreciated.
=20
Thanks,
Bryan
=20
=20
=20


------_=_NextPart_001_01C6DCBC.A12ECB9E--


Reply With Quote
  #5  
Old   
Matt Dargavel
 
Posts: n/a

Default RE: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE AWAY" - 09-21-2006 , 06:20 AM



I think it depends which version of MySQL you're using, but the MySQL API in
5.1 is mysql_options:
http://dev.mysql.com/doc/refman/5.1/...l-options.html. This is the API
that the version of Mysql++ I have uses for implementing
Connection::set_option().

Pre version 5, I don't think there was a reconnect option for this API;
however, according to the 4.1 docs the reconnect flag is kept in the MYSQL
structure and is set automatically by mysql_real_connect.


-----Original Message-----
From: Julien Chavanton [mailto:jc (AT) atlastelecom (DOT) com]
Sent: 20 September 2006 14:57
To: plusplus (AT) lists (DOT) mysql.com
Subject: RE: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE
AWAY"




Quote:
Think I figured it out.

m_db_conn = new Connection( db_name, host, username, pw, port);
if(m_db_conn->connected())
{
m_db_conn->set_option(Connection::Option:pt_reconnect, true); }
This is interesting however; it seems like this solution uses an abstraction
of Mysql++ API?
Can you provide the equivalent C API function call to Mysql++





Quote:
We have the same issue so I am also curious what the recommended
approach
is.


Bruce


From: "Bryan Seay" <bseay@stripped
To: <plusplus@stripped
Subject: Daemon passes wait_timeout and gets "MYSQL SERVER HAS GONE
AWAY"
Date: Thu, 7 Sep 2006 10:28:40 -0500
I have a daemon running 24/7 that uses the mysql++ package to connect
to my
database. It works great but after it passes the wait_timeout of the
server it, of course, spits out a "MYSQL SERVER HAS GONE AWAY".

My question is what is the correct way to deal with this? Is there
some
option I am not seeing that will make the daemon reconnect to the db
if it
fails? Or should I put a timer in my code that "pings" the database
occasionally to keep the connection open?

Any ideas are appreciated.

Thanks,
Bryan






--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.