commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Waldhoff <>
Subject AbandonedObjectPool (was Re: DBCP Timing out)
Date Wed, 18 Dec 2002 00:37:42 GMT
I believe AbandonedObjectPool (an extension of GOP), provides the
functionality you're looking for, although I've never used it personally.

Jdbc2Pool (available in the nightly builds) uses AbandonedObjectPool by
default.  It should be easy to replace BasicDataSource (the dbcp
configuration as described in the tomcat docs) with Jdbc2Pool if that's
what you're using.  See the docs at:


PoolingDriver and PoolingDataSource can also be configured to use AOP
instead of GOP. See:


for more on PoolingDriver and PoolingDataSource configuration.

On Tue, 17 Dec 2002, Paul Dwinnell wrote:

> >> a) I get 5 connections and then I Thread.sleep for 30 seconds before
> >> closing the obtained connections. On the same time I monitor the number
> >> of open sessions on my DB which is ALWAYS 5. Shouldn't this number be
> >> reduced to '2' after the 5000millis (when eviction mechanism initiates)?
> >No, you've got that backwards. The only connections available for eviction
> >in this way are those that are sitting idle in the pool.  If you have
> >borrowed (via getConnection), but not returned (via Connection.close()) the
> >connection, it can't be evicted.
> It appears that the settings in 'GenericObjectPool' for eviction are related
> to
> idle connections in the pool (not borrowed).  Is there a way to drop/remove
> connections that have been 'borrowed' after they have sat idle for a certain
> amount of time?  I want to prevent a process from holding a connection
> indefinately.
> thanks
> Paul

View raw message