commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timko, Cheryl A." <cheryl_ti...@merck.com>
Subject RE: DBCP Connection recycling
Date Wed, 09 Apr 2003 11:57:05 GMT
Be aware, pool.close() will close all the connections idle in the pool.
Connections that are currently being used will not be closed.... Which, in
your case, I am not sure if it really matters.

- Cheryl

-----Original Message-----
From: Ramrakhiani, Vikas [mailto:Vikas-Ramrakhiani@deshaw.com] 
Sent: Wednesday, April 09, 2003 1:32 AM
To: 'Jakarta Commons Users List'
Subject: RE: DBCP Connection recycling


You may use pool.close() and reload the pool again.

vikas.

-----Original Message-----
From: Saravanan Bellan [mailto:Saravanan.Bellan@veritas.com]
Sent: Wednesday, April 09, 2003 3:15 AM
To: 'commons-user@jakarta.apache.org'
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
the
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
closer
to maxActive.


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

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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org

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



------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of Merck
& Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary
copyrighted and/or legally privileged, and is intended solely for the use of the individual
or entity named in this message.  If you are not the intended recipient, and have received
this message in error, please immediately return this by e-mail and then delete it.

==============================================================================


Mime
View raw message