Seetha, > 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? -chris
signature.asc
Description: OpenPGP digital signature