commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramrakhiani, Vikas" <>
Subject RE: DBCP Connection recycling
Date Wed, 09 Apr 2003 05:32:07 GMT
You may use pool.close() and reload the pool again.


-----Original Message-----
From: Saravanan Bellan []
Sent: Wednesday, April 09, 2003 3:15 AM
To: ''
Subject: DBCP Connection recycling

I want the connections in my pool to be recycled after a certain period
of time or certain number of connections. What I mean by recycle is close
actual connection and open a new one. The reason for this is that Postgres
on windows leaks semaphore handles if the same connection is being used for
extended period of time.

I was thinking that the removeAbandoned parameter would do something, but it
kicks in
only during some extreme cases, like the numIdle < 2  and numActive is
to maxActive.

    public synchronized Object borrowObject() throws Exception {
        try {
            if (config != null
                    && config.getRemoveAbandoned()
                    && (getNumIdle() < 2)
                    && (getNumActive() > getMaxActive() - 3) ) {

I want to be able to recycle the connection irrespective of idle
and active connections.

Is there a way to do it? If not can it be taken as a valid enhancement
request(a new parameter timetolive, for eg.)

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

View raw message