commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: [DBCP] Somebody explain me eviction feature ?
Date Wed, 18 Aug 2004 14:37:45 GMT
The eviction feature prevents connections to be broken by firewall 
idle timeout (you set the pool idle timeout lower then the firewall 
idle timeout).

These broken connections will also be detected by the testOnBorrow but 
it depends on the database driver, OS & network how fast this will be 
detected. If there are multiple broken connections in the pool this 
can take a relative long time but eventually all broken connection 
will be removed.

By the way, this won't help against a connection leak. If numActive 
reaches maxActive then all these connections are in use by your 
application and if it doesn't go down then somewhere, somehow the 
close method isn't called.

You could try to enable the abandoned feature or log the pool usage 
(numActive / numIdle) during the day and see how the pool usage evolves.

-- Dirk


Vjeran Marcinko wrote:

> ----- Original Message ----- 
> From: "Dirk Verbeeck" <dirk.verbeeck@pandora.be>
> To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> Sent: Wednesday, August 18, 2004 11:42 AM
> Subject: Re: [DBCP] Somebody explain me eviction feature ?
> 
> 
> 
>>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.
> 
> 
> But is 'testOnBorrow' sufficient even if I have this situation with firewall
> ? Or eviction feature should be enabled then beside 'testOnBorrow' ?
> 
> I am also wondering if I have this 'invalid' connection in pool, and
> validation querying should discover it, how long does it usually take for
> this validation query to fail (or throw exception) ? Is it momentarily, or
> this thread will wait for a while, thus applicaition user will think it has
> hanged ?
> 
> The reason for all this is because I have case where I use testOnBorrow
> feature (without idle evicting feature), in deployment with firewall between
> my app and db, my app always calls connection.close() in finally block, and
> my app gets stuck once every day. Number of connections in pool gets
> exhausted....
> 
> -Vjeran




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message