tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat fails to refresh connections when mySQL server on linux is shutdown and restarted
Date Fri, 21 Jul 2006 12:39:20 GMT

> Are you getting the connection anew after restarting the server?  It looks
> like you have this case:
> T0	Connection x = Datasource.getConnection()
> T1	Do some stuff
> T2	Shutdown / restart MySQL
> T3	x.prepareStatement() or other stuff
> ... FAIL
> The connection pool will only renew the connection on the
> Datasource.getConnection() (the validation query, SELECT 1, will only run on
> getConnection() -- in your case with test on borrow)

You could get this kind of thing happening if you were storing JDBC
Connections in the user's session. If the Connection is shut down and
serialized along with the session during the restart, then you will have
an invalid Connection in the session when Tomcat comes back up.

Do you do anything like this in your application?


View raw message