Connection timeouts

This is a discussion on Connection timeouts within the MySQL Database forums, part of the Database Forums category; Hi all. I have a couple of serverprograms running on my Linuxbox that has a connection open to a MySQL (...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2006
ZoombyWoof
 
Posts: n/a
Default Connection timeouts

Hi all. I have a couple of serverprograms running on my Linuxbox that
has a connection open to a MySQL (5.0.18) database. These serverprograms
doesnt work much :-), they get called by clients once in a while,
sometimes it can be days between they have to do any work. When they are
started they connect to the MySQL database and then they wait for a
client to connect to them and command the server to work vs the
database. So, I want the connection to stay alive all the time, but this
seems a bit hard...I have tried to set the MYSQL_OPT_RECONNECT to true
before issuing the 'mysql_real_connect' call (I'm using the C-api) but
that doesnt seem to work. The servers gets the
"--:*MySQL server has gone away"
back after a while.

Is there a way to keep a connection alive for a *very* long time if
desired ?

Thanx

/ZW
Reply With Quote
  #2 (permalink)  
Old 03-04-2006
Benedictum
 
Posts: n/a
Default Re: Connection timeouts

You have to set up a timer on your clients app to ping the server
automatically every time you are close to the timeout setting of the server.


"ZoombyWoof" <zoombywoofremove@thishotmail.com> wrote in message
news:Gn4Kf.5502$zc1.3520@amstwist00...
> Hi all. I have a couple of serverprograms running on my Linuxbox that has
> a connection open to a MySQL (5.0.18) database. These serverprograms
> doesnt work much :-), they get called by clients once in a while,
> sometimes it can be days between they have to do any work. When they are
> started they connect to the MySQL database and then they wait for a client
> to connect to them and command the server to work vs the database. So, I
> want the connection to stay alive all the time, but this seems a bit
> hard...I have tried to set the MYSQL_OPT_RECONNECT to true before issuing
> the 'mysql_real_connect' call (I'm using the C-api) but that doesnt seem
> to work. The servers gets the
> "--:*MySQL server has gone away"
> back after a while.
>
> Is there a way to keep a connection alive for a *very* long time if
> desired ?
>
> Thanx
>
> /ZW



Reply With Quote
  #3 (permalink)  
Old 03-04-2006
Benedictum
 
Posts: n/a
Default Re: Connection timeouts

SEE -> http://dev.mysql.com/doc/refman/5.0/en/mysql-ping.html

--B

"ZoombyWoof" <zoombywoofremove@thishotmail.com> wrote in message
news:Gn4Kf.5502$zc1.3520@amstwist00...
> Hi all. I have a couple of serverprograms running on my Linuxbox that has
> a connection open to a MySQL (5.0.18) database. These serverprograms
> doesnt work much :-), they get called by clients once in a while,
> sometimes it can be days between they have to do any work. When they are
> started they connect to the MySQL database and then they wait for a client
> to connect to them and command the server to work vs the database. So, I
> want the connection to stay alive all the time, but this seems a bit
> hard...I have tried to set the MYSQL_OPT_RECONNECT to true before issuing
> the 'mysql_real_connect' call (I'm using the C-api) but that doesnt seem
> to work. The servers gets the
> "--:*MySQL server has gone away"
> back after a while.
>
> Is there a way to keep a connection alive for a *very* long time if
> desired ?
>
> Thanx
>
> /ZW



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:56 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0