ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Campbell <michael.campb...@gmail.com>
Subject Re: No operations allowed after connection closed.
Date Sun, 16 Oct 2005 14:15:19 GMT
On 10/16/05, Sven Boden <list123@pandora.be> wrote:
>
> If you're not yet using autoReconnect in the URL of your pool, can you
> try using that. As in the following way:
>
> jdbc:mysql://host/db_hame?autoReconnect=true
>
> Note the upper case R in autoReconnect (it's case sensitive).

Your suggestion here got me intrigued, as I am using an older version of the
driver, so decided to go look at the docs for this.

MySql warns: (emphasis mine)

If enabled the driver will throw an exception for a queries issued on a
stale or dead connection, which belong to the current transaction, but will
attempt reconnect before the next query issued on the connection in a new
transaction. The use of this feature is not recommended, because it has side
effects related to session state and data consistency when applications
don'thandle SQLExceptions properly, and is only designed to be used when you
are unable to configure your application to handle SQLExceptions resulting
from dead and/or stale connections properly. Alternatively, investigate
setting the MySQL server variable "wait_timeout"to some high value rather
than the default of 8 hours.


Still, if it fixes the OP's original problem, so much the better I guess.

--
I tend to view "truly flexible" by another term: "Make everything equally
hard". -- DHH

Mime
View raw message