On 8/25/06, Eric Bauld <[EMAIL PROTECTED]> wrote:
Im having a heck of a time finding the right way to fix this.
I have a servlet on a tomcat server, it uses ibatis. It works great as
long as it is being used but when it sits overnight, the connection
times out and the next person to use it will get an error. But then it
will work for every request thereafter.
I get this exception after it has been sitting.
java.sql.SQLException: No operations allowed after connection closed
Anyone know of a way to test this to see if the connection has closed ?
If you're using DBCP for your connection pooling, see this:
http://jakarta.apache.org/commons/dbcp/configuration.html
Specifically the testOnBorrow and validationQuery params.
I could just put a bogus query + error catch to "wake up" the
connection, but its not a very proper fix.
- Eric
--
Kris Schneider <mailto:[EMAIL PROTECTED]>