commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amund Elstad <>
Subject [POOL] Bug in org.apache.commons.pool.impl.GenericObjectPool
Date Thu, 05 Sep 2002 08:38:59 GMT

In borrowObject() the test (to check if the the pool is exhausted): 

	if(_maxActive > 0 && _numActive < _maxActive) 

fails if _maxActive is <= 0 causing a block. This behaviour is 
not according to the documentation: when maxActive is non-positive
there is no limit to the number of objects that may be active at one time.

IMO the test should be replaced by:

	if(_maxActive <= 0 || _numActive < _maxActive)

Sorry for not including a patch but I am currently on work (Windows)
and have no suitable diff-tool installed.

amund elstad

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message