ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kris Schneider" <kschnei...@gmail.com>
Subject Re: Connection closing after timeout on tomcat
Date Fri, 25 Aug 2006 19:00:19 GMT
On 8/25/06, Eric Bauld <baulde@cpsc.ucalgary.ca> 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:kschneider@gmail.com>

Mime
View raw message