Neale Banks said:

>
> Can it be done?
>
> I tried to disable this timer with wait_timeout = 0 in my.cnf.
>
> That changed the timeout (as reported by mysqladmin variables) from the
> default 28800 to 1.  Tested, it was definitely a one-second timeout :-(
>
> As a hack-around, I've currently got it set to ten days.
>
> Alternatively, where is the bounds for the value of wait_timeout
> documented?
>
> Lastly, this is for a long-held JDBC connection from an application server
> which could run for days, no, weeks - and gets upset if mysql closes down
> the connection (e.g. overnight/weekends). Any suggestions on a better way
> to handle this?

Neale,

JDBC connections aren't guaranteed to last forever (I even checked with
the JDBC spec lead on this).

You need to make sure your application has the 'smarts' to handle
connection failure, and re-connect and retry the transaction (if it makes
sense), or mark the current connection as bad, pass the exception up the
stack, and re-establish the connection later.

Connections don't go away just because of wait_timeout, someone might
unplug a switch, restart the database server, ifconfig an interface down,
router flakes out...There are many potential failure scenarios for a
network connection, and only your application will know what the _prudent_
action to take (retry immediately, throw error retry later, shutdown, etc0
is.

Luckily, most application servers' connection pools have parameters you
can configure to expire connections that have been idle too long, test
connections while they are idle to see that they are still valid, test
connections before handing them out, or when getting them returned, etc.,
etc.

Regards,

   -Mark

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to