commons-dev mailing list archives

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

It can be done!

org.apache.commons.dbcp.AbandonedObjectPool extends
org.apache.commons.pool.impl.GenericObjectPool.

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

But, actually invoking it gets more interesting =)

1.  If you are using PoolingDriver, then just do a
getPool(name).clear().

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

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
finding.


matthew


>>> "Dick Zetterberg" <dick@transitor.se> 4/09/02 20:24:09 >>>
Hi,

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

Is there a way to accomplish this?

Best regards,

Dick Zetterberg
dick@transitor.se 



--
To unsubscribe, e-mail:  
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message