commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <>
Subject Re: [DBCP] Somebody explain me eviction feature ?
Date Wed, 18 Aug 2004 09:42:54 GMT
The eviction thread will run every "timeBetweenEvictionRunsMillis" ms.
Each run it will test "numTestsPerEvictionRun" connections.
First it will test if a connection has been idle for more then 
"minEvictableIdleTimeMillis" ms and remove the connection if it is too 
Secondly if testWhileIdle is enabled the connection will be tested 
using the validationQuery and invalid connection are removed.
At the end the eviction thread also checks the minIdle and creates new 
connections if needed.

If you use testOnBorrow then you don't need testWhileIdle.
Evicting old cnnections is usefull wel you have a database or firewell 
that closes idle connections.

-- Dirk

Vjeran Marcinko wrote:

> Hi again.
> Can someone explain me when is eviction feature useful ? 'testOnBorrow'
> feature seems to me as really robust way to fetch valid db connections, thus
> why is this eviction feature needed anyway ?
> Are there some situations when 'testOnBorrow' is not enough ?
> Regards,
> Vjeran

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

View raw message