RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-03 Thread Waldhoff, Rodney
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.

RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-03 Thread Waldhoff, Rodney
I wrote: I'm also a little confused as to its purpose, but it shouldn't be too difficult to do the wrapping at the Pool level instead of the PoolableObjectFactory (ConnectionFactory) level. This may actually simplify a number of things, in addition to making the behavior you

Re: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-03 Thread Lev Assinovsky
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

[DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-02 Thread Anjan
Hi, 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

RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-02 Thread Waldhoff, Rodney
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

RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-02 Thread Anjan
: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

Re: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-02 Thread John McNally
:[EMAIL PROTECTED]] 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

RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-02 Thread Waldhoff, Rodney
: Tuesday, April 02, 2002 5:32 PM To: Jakarta Commons Developers List Subject: Re: [DBCP] : DelegatingConnection/PoolableConnection Bug ? I'm not sure what is being proposed here, so if this is wrong let me know. But code that is something like the following is not a good idea: Connection con

RE: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-02 Thread Anjan
Subject: Re: [DBCP] : DelegatingConnection/PoolableConnection Bug ? I'm not sure what is being proposed here, so if this is wrong let me know. But code that is something like the following is not a good idea: Connection con = pool.getConnection(); ...do something... con.close

Re: [DBCP] : DelegatingConnection/PoolableConnection Bug ?

2002-04-02 Thread John McNally
Anjan wrote: Hi Rodney/John, I'm not sure what is being proposed here, so if this is wrong let me know. But code that is something like the following is not a good idea: Connection con = pool.getConnection(); ...do something... con.close(); ... if (!con.isClosed()) con.close();