Megan,
We had a similar problem. The legacy DB that we were interfacing with would periodically go down for backups and sometimes go completely offline. This would at times hang the DB because it thought that we still had an open connection, and at other times it would leave "dead" connections in our pool which would randomly get used and would fail. I found that calling the "close()" method on the BasicDataSource object released all connections in the pool. Understand that this will kill ALL connections, even ones currently being used, so be very careful when using it. Also, you will pay the standard penalty of establishing those connections again when DBCP has to rebuild its pool. Good luck!
--- regards --- Larry
At 08:34 AM 1/28/05, you wrote:
We don't want to rely on the garbage collector to close our connections. We want to explicitly close them ourselves. Is there a method to explicitly close all the connections in the data source's pool?
-----Original Message----- From: haipeng du [mailto:[EMAIL PROTECTED] Sent: Friday, January 28, 2005 10:13 AM To: Jakarta Commons Users List Subject: Re: [DBCP] Force active connections closed in BasicDataSource
destroy your datasource.
On Fri, 28 Jan 2005 10:06:38 -0500, Meyer, Megan K. <[EMAIL PROTECTED]> wrote: > Hello, > > I'm using a BasicDataSource for connection pooling to our database in > a standalone application. The application requires that we have a > backup and restore capability at runtime. We've found that calling > close() on the BasicDataSource doesn't cleanly close all connections > to the database whenever there are active connections that have been > borrowed from the pool. > > Is there a way to force all connections in the pool closed, even if > active connections have been lent out? > > Thanks in advance, > Megan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
-- Haipeng Du Software Engineer Comphealth, Salt Lake City
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------
Larry Young
The Dalmatian Group
www.dalmatian.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
