![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
|
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 |
#5
| |||
| |||
|
|
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); } |
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |