commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DBCP-331) SharedPoolDataSource does not handle null keys correctly
Date Wed, 21 Apr 2010 10:44:51 GMT

    [ https://issues.apache.org/jira/browse/DBCP-331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859292#action_12859292
] 

Phil Steitz commented on DBCP-331:
----------------------------------

Thanks.  That will make it easier.   As I said above, it would also be great if you could
explain why each change is necessary and how exactly the current code can fail.   The change
I called out above - pulling the latch out of the queue each time through the loop - is problematic
as it will in general not preserve fairness, which is the reason that the queue is there.

> SharedPoolDataSource does not handle null keys correctly
> --------------------------------------------------------
>
>                 Key: DBCP-331
>                 URL: https://issues.apache.org/jira/browse/DBCP-331
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>         Environment: Windows, java version "1.6.0_06", Torque 3.3 (DBCP 1.4, jTDS 1.2.5)
>            Reporter: Gabor Horvath
>         Attachments: GenericKeyedObjectPool.java
>
>
> GenericKeyedObjectPool.borrowObject does not invalidate object if validateObject fails
(line ~1200). I guess invalidation would be needed for objects which are not newly created
(newlyCreated flag in the code).
> Scenario:
> 1.) DB connection put into pool
> 2.) Attempt to reuse connection (borrowObject)
> 3.) Test on borrow (executing simple SQL query) fails: DB connection closed on jTDS level
but connection remains in the pool
> 4.) Subsequent attempts to reuse the connection causes "java.sql.SQLException: Invalid
state, the Connection object is closed"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message