commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33167] - [dbcp] Individual connection close method
Date Tue, 15 Feb 2005 18:17:26 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33167>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33167





------- Additional Comments From dirk.verbeeck@pandora.be  2005-02-15 19:17 -------
I have added your method locally and ran the testcase but if fails.
The assertTrue(c.isClosed()); fails because the connection is still open. This
is normal, the pool is closed but the connection remains open.

After I removed the assert I got the following stacktrace:
org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection info
from pool
    at
org.apache.commons.dbcp.datasources.PerUserPoolDataSource.getPooledConnectionAndInfo(PerUserPoolDataSource.java:396)
    at
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:631)
    at
org.apache.commons.dbcp.datasources.TestPerUserPoolDataSource.testClosing1(TestPerUserPoolDataSource.java:567)
...
Caused by: java.lang.IllegalStateException: Pool not open
    at org.apache.commons.pool.BaseObjectPool.assertOpen(BaseObjectPool.java:78)
    at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:776)
    at
org.apache.commons.dbcp.datasources.PerUserPoolDataSource.getPooledConnectionAndInfo(PerUserPoolDataSource.java:393)
    ... 17 more

This is what I expected, the closed pool cannot be reused. It must be
unregistered in a way that getPooledConnectionAndInfo() will create a new pool
for the user. (simply removing it from the HashMap?) 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message