commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject [dbcp] Re: Timeout for Idle Connections
Date Tue, 23 Feb 2010 02:18:51 GMT
Patrick Kranz wrote:
> Hello list,
> I've been playing around with the DBCP for quite some time now, because
> I want to get rid of Oracles Connection Pool. The only problem I still
> wasn't able to solve is the following:
> In my Oracle Pool a connection gets closed within the pool after some
> configurable amount of time. That means, if I have configured a maximum
> idle of 4 and a maximum active of 10, the six connections that are
> between these two limits are closed after for example 30 seconds. That
> way these connections stay open as long as my period of high load lasts,
> even if there are a few seconds without the need for more than 4
> connections.
> The DBCP seems to work differently meaning that with the same
> configuration every connection that is outside the maxIdle limit is
> closed the moment the connection is returned to the pool.
> Maybe my assumption is wrong but I think depending on the way the
> application is used, the way DBCP handles connections might result in a
> higher rate of constructing new connections.
> So, is there any way to achieve the "Oracle way" that I did not stumble
> into or was this simply never considered?

See the minEvictableIdleTimeMillis property of BasicDataSource
and/or softMinEvictableIdleTimeMillis of GenericObjectPool if you
are managing the pool directly.  To use either of these properties,
you need to enable the idle object evictor by setting the
timeBetweenEvictionRunsMillis property to a positive value.


> Cheers,
> Patrick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message