On 10/16/05, Sven Boden <[EMAIL PROTECTED]> 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
- Re: No operations allowed after connection closed. Michael Campbell
- Re: No operations allowed after connection closed. Clinton Begin
