[ 
http://issues.apache.org/jira/browse/POOL-38?page=comments#action_12412484 ] 

Sandy McArthur commented on POOL-38:
------------------------------------

The behavior you are complaining about seems to be the configured behavior. If 
you do don't like that the pool waits indefinitely then set a maxWait[1] and 
your code will get an exception after the timeout. I don't see an issue here 
with pool and I don't know what you would want changed in pool.

1. 
http://jakarta.apache.org/commons/pool/apidocs/org/apache/commons/pool/impl/GenericObjectPool.html#setMaxWait(long)

> 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

>
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to