commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Firth <>
Subject re: [DBCP] How to remove all connections from pool?
Date Thu, 05 Sep 2002 12:09:18 GMT

It can be done!

org.apache.commons.dbcp.AbandonedObjectPool extends

The latter has a "clear()" method which I suspect will do what you

But, actually invoking it gets more interesting =)

1.  If you are using PoolingDriver, then just do a

2.  If you are using PoolingDataSource directly, then that class will
need (?) to be extended to have a clear() method which calls

3.  If you are using BasicDataSource, then you'd need to implement (2)
and then add a "clear()" method to call "createDataSource().clear()".

But then again, I'm no expert & most certainly no committer.   

/me must sit down and write patches for all these things I keep


>>> "Dick Zetterberg" <> 4/09/02 20:24:09 >>>

I am using the DBCP package together with a Microsoft Access database
standard odbc bridge driver).
At certain points I wish to replace the whole Access database file with
new file. This is however impossible as long as my application still
open connections to it.
So I want to be able to tell the pool to release all connections it
opened (really closing them).

Is there a way to accomplish this?

Best regards,

Dick Zetterberg 

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

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

View raw message