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

Gabor Horvath commented on DBCP-331:
------------------------------------

Thanks for checking. I should have really considered the threading issues, I 
didn't catch the related comments in header...

Just in nutshell, I had problem with connection pooling. Above layers get 
connections in invalid state; quite difficult to reproduce this symptom but 
happens under heavy load. I will try to provide a test application maybe next 
week.

For 1 and 2 I just checked the code and found that part where new object is 
created without synchronization; this can have sideeffect in case the latch 
remains in the allocation queue. As I saw chance for that by tracing, I 
synchronized it and also changed the allocate method to handle the situation if 
an object is already assigned to the latch... I try to create patches for these.

Regarding 3.) you are totally right.


> 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.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to