commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anjan" <>
Subject [DBCP] : DelegatingConnection/PoolableConnection Bug ?
Date Tue, 02 Apr 2002 16:03:56 GMT

	I have been using DBCP with mySQL and Oracle using
DriverManagerConnectionFactory, StackObjectPool and KeyedObjectPoolFactory.
I use the code like follows :
I am getting an exception from PoolableConnection (saying that the
Connection is
already closed) when I call a sequence like this

if (conn.isClosed()) {
   conn.close(); // THROWS EXCEPTION

I found that the method DelegatingConnection.isClosed() is delegating it to
the underlying driver (mySQL)-- where connection state
is open (since the Connection was only returned to the pool). close() is
obviously not delegated to the underlying driver.

Am I missing something here -- it appears that this functionality should
been tested by the user base by now ?

Should we be intercepting the isClosed() at PoolableConnection() instead of
letting DelegatingConnection handle it ?

I'm currently eating the exception -- but believe that this should be fixed.
Can work on a fix if I get a suitable suggestion.

Thanks very much,

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

View raw message