dbTalk Databases Forums  

Connection Timeouts

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


Discuss Connection Timeouts in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brian Campbell
 
Posts: n/a

Default Connection Timeouts - 10-04-2006 , 10:00 AM






Hi all,

What's the best way to set connection timeouts to a long value (an hour or
more)? I've got code that creates a group of connections and set the
timeout for each one to a large value (3600, 36000, etc). I put these
connection in a pool and hand them out when needed. Before I hand out the
connection, I call the ping() method. The ping() method returns non-zero on
all my connections after a minute or two. So I have to drop the connections
and recreate new ones (which defeats the point of having a pool). I
actually set the connection value twice (each has the same value) when I
create the connection. I call set_option( opt_connect_timeout, 360000 )
after I create the connection object. I also pass in 360000 as the timeout
value to the connect() method. Neither of these seem to have an effect on
the timeout behavior. Any help is appreciated.

Thanks!

-Brian


--------------------
Brian E Campbell
becampbel (AT) hotmail (DOT) com



--
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   
Warren Young
 
Posts: n/a

Default Re: Connection Timeouts - 10-04-2006 , 10:08 AM






Brian Campbell wrote:
Quote:
What's the best way to set connection timeouts to a long value
Add wait_timeout=REALLYBIGNUMBER to the [mysqld] section of /etc/my.cnf.

--
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   
Brian Campbell
 
Posts: n/a

Default Re: Connection Timeouts - 10-04-2006 , 10:15 AM



Hi Warren,

Thanks for the response. Currently, I do not have a /etc/my.cnf file. Is
this the only way to do it? Is there a programmatic way to do it or is this
a limitation of the MySQL API? Thanks.

-Brian

--------------------
Brian E Campbell
becampbel (AT) hotmail (DOT) com





Quote:
From: Warren Young <mysqlpp (AT) etr-usa (DOT) com
Reply-To: plusplus (AT) lists (DOT) mysql.com
To: MySQL++ Mailing List <plusplus (AT) lists (DOT) mysql.com
Subject: Re: Connection Timeouts
Date: Wed, 04 Oct 2006 09:08:22 -0600

Brian Campbell wrote:

What's the best way to set connection timeouts to a long value

Add wait_timeout=REALLYBIGNUMBER to the [mysqld] section of /etc/my.cnf.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsu...mail (DOT) com



--
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   
Warren Young
 
Posts: n/a

Default Re: Connection Timeouts - 10-04-2006 , 10:43 AM



Brian Campbell wrote:
Quote:
Currently, I do not have a /etc/my.cnf file.
So make one. MySQL just uses default values if there is no file.
The file is there only to override defaults...such as the 8 hour idle
timeout.

Quote:
Is this the only way to do it?
Yes.

If you want to discuss this further, please take up on the main MySQL
list, where this is on topic.

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