commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anjan" <an...@bluewireless.com>
Subject RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?
Date Tue, 02 Apr 2002 22:36:35 GMT
Hi Rodney!,

	Thank you for acknowledging that this could need a fix.

	Use Case : Our software can use multiple databases(oracle, mysql) 
at the same time. During initialization, I get a connection from each
database and do some queries in a LOOP. The finally {} block cleans up any
connections if there were any exceptions. That's where I try to find if
it's closed -- connection.isClose() . If it's not closed, I close it to
prevent leakage.

FIX : You understood me correctly. Yes, As far as the client program is 
concerned, if a previous block of code has already closed the connection,
then the connection.isClosed() should return true. To get this
behavior, we need to modify PoolableConnection? Can you suggest how to fix
this ?

Thank you,

Best Regards,
ANJAN. B

-----Original Message-----
From: Waldhoff, Rodney [mailto:rwaldhof@us.britannica.com]
Sent: Tuesday, April 02, 2002 1:32 PM
To: 'Jakarta Commons Developers List'
Subject: RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?


Can't say that I use Connection.isClosed often if at all, nor that I fully
understand the use cases here.

Technically speaking, if the underlying connection isn't closed, then
PoolableConnection still has an open channel to the database.  Does that
mean isClosed should return true?

I think you're suggesting that PoolableConnection.isClosed should return
true when the connection is in the pool, false when it's out of the pool
(and the underlying connection isn't closed either).  Sounds reasonable to
me.


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