commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Waldhoff <>
Subject Re: [DBCP] connection closing problem
Date Thu, 23 Jan 2003 21:39:41 GMT
On Thu, 23 Jan 2003, Cindy Ballreich wrote:

> Some time back I did an experiment using DBCP with Tomcat (JNDI) and
> MySQL. I was able to get a beautiful connection pool, but the connection
> to the database seemed to die after an extended period of idleness.

I was unable to find your previous message (in any) in the archives.
Typically this symptom is caused by a database-level "evict idle
connections" strategy.  One solution is to configure a validation query to
ping the database periodically (so that the db knows the connection is
still in use).  Another solution is to configure the pool to "test on
borrow", so that connections that are dropped by the database are dropped
by the pool before they are returned to your client code.  The precise
configuration of either depends upon the specific pooling approach you're
using (BasicDataSource, JDBC2DataSource, Pooling[Driver|DataSource], etc.)

Can you give a validation query a try, or provide more details on the
precise problem you're having?

View raw message