commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lev Assinovsky <>
Subject Re: [DBCP] : DelegatingConnection/PoolableConnection Bug ?
Date Wed, 03 Apr 2002 12:40:09 GMT
Guys, about the same problem is in BasicDataSource.
When we get datasource from JNDI (BasicDatasourceFactory)
we get DataSource type not BasicDataSource which is good (an abstraction
is provided) 

But DataSource class doesn't have method close().
I wouldn't like to cast my DataSource instance to BasicDataSource to
close() method.
In the same time we need to release pool resources (and especially
database connections) when application is finished.
What if to add  finalize() method to BasicDataSource and call close from
And make the same with pool and so on.

"Waldhoff, Rodney" wrote:
> I agree with John's idiom of putting the close() call in a finally block.  I
> think most people do it that way, which may be why this bug was never
> uncovered before.
> But I also think Anjan's right that this is a bug, and I've just corrected
> the behavior and added a unit test that demonstrates.  (Actually, it was
> really easy, we already had a flag called "_closed" in PoolableConnection
> that told us whether or not the PoolableConnection was "active" or "idle" in
> the pool. We just weren't using it in isClosed().)
> A current build from source, or the next nightly distribution should contain
> the fix.
>  - Rod

Lev Assinovsky                Peterlink Web
Programmer		      St. Petersburg, Russia
Tel/Fax: +7 812 3275343       197022 ul.Chapigina 7Á

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

View raw message