I am running a simple test servlet in Tomcat 5.0.28. Essentially, I send the
servlet an SQL query, the servlet uses a connection pool to connect to a
MySQL DB.
Everything works fine. However, if, say, roughly, say, 12 or more hours
elapse (i.e. "overnight") and I make a a call to the servlet, where
typically it would return the value of a row from a resultset to me, it
returns nothing. If I subsequently refresh the browser, everything works
back to normal.
For a long time, I thought perhaps this was merely because MySQL had some
parameter within it that made it go to sleep -- but that is not the case
here. This is somethign with Tomcat, and the browser refresh solution is the
clue to what might be wrong. Can anyone point me in the right direction
here? Thanks.
Lew - 06 May 2007 13:23 GMT
> I am running a simple test servlet in Tomcat 5.0.28. Essentially, I send the
> servlet an SQL query, the servlet uses a connection pool to connect to a
[quoted text clipped - 11 lines]
> clue to what might be wrong. Can anyone point me in the right direction
> here? Thanks.
Either the session or the connection timed out. The refresh either
established a new session or a new connection.

Signature
Lew
Philipp Taprogge - 06 May 2007 13:27 GMT
Hi!
> Can anyone point me in the right direction
> here? Thanks.
Probably, the connections in the pool time out over time. Make sure
you configure your DataSource with ?autoreconnect=true...
HTH,
Phil