You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Sandy McArthur (JIRA)" <ji...@apache.org> on 2006/05/20 17:57:31 UTC

[jira] Closed: (POOL-38) Deadlock

     [ http://issues.apache.org/jira/browse/POOL-38?page=all ]
     
Sandy McArthur closed POOL-38:
------------------------------

    Resolution: Invalid
     Assign To: Sandy McArthur

Closing, this isn't a bug. maxActive issue tracked with DBCP-188

> Deadlock
> --------
>
>          Key: POOL-38
>          URL: http://issues.apache.org/jira/browse/POOL-38
>      Project: Commons Pool
>         Type: Bug

>  Environment: 10 Threads, Default Configuration
>     Reporter: Fuad Efendi
>     Assignee: Sandy McArthur

>
> Here is the use case:
> - 8 Threads
> - Each Thread needs 2 objects from a pool
> - Pool has limit: 8 objects (default for DBCP)
> - After receiving first object from a pool, Thread calls wait() method on GenericObjectPool, to get access to released object
> - All Threads are waiting... (deadlock)
> I found it by running simple test with Hibernate & Spring, Hibernate needs second Connection to retrieve primary key from a database in a separate context. Anyway, synchronize/wait/notify IS NOT a best practice (2006, May).
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject() - line 810
> MISTAKE at http://jakarta.apache.org/commons/dbcp/configuration.html:
> maxActive = "The maximum number of active connections that can be allocated from this pool at the same time, or zero for no limit. "
> - should be -1 instead of 'zero for no limit'. However, it does not help if I need to limit number of objects in a pool...
> Weak docs are a bug also... please note time spending for troubleshooting such tricky deadlocks...
> Cheers,
> Fuad Efendi

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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