Apache Commons logo Commons Pool

Apache Commons Pool Changes

Release History

Version Date Description
2.4 2015-05-27 This is a maintenance release that includes bug fixes and minor enhancements.
2.3 2014-12-30 This is a maintenance release that includes bug fixes and minor enhancements.
2.2 2014-02-24 This is a maintenance release that adds a new testOnCreate configuration option and fixes a small number of bugs.
2.1 2013-12-30 This is a maintenance release that includes a small number of new features as well as including bugfixes and test case improvements.
2.0 2013-11-11 This is a major new release that provides significant performance improvements in high concurrency environments. Pools now provide a mechanism for tracking objects that have been borrowed from the pool but not returned. There have been numerous API changes to support these and other new features as well as to clarify behaviour and improve consistency across the API. This release requires JDK level 1.6 or above.
1.6 2012-01-07 Adds generics and requires Java 5.
1.5.7 2011-12-20 This is a patch release, including bugfixes only.
1.5.6 2011-04-03 This is a patch release, including bugfixes only.
1.5.5 2010-09-10 This is a patch release, including bugfixes, documentation improvements and some deprecations in preparation for pool 2.0.
1.5.4 2009-11-20 This is a patch release containing a fix for POOL-152, a regression introduced in version 1.5.
1.5.3 2009-09-21 This is a patch release containing a fix for POOL-149, a regression introduced in version 1.5.
1.5.2 2009-07-12 This is a patch release containing fixes for POOL-146 and POOL-147, regressions introduced in version 1.5.
1.5.1 2009-06-16 This is a patch release containing a fix for POOL-144, a regression introduced in version 1.5.
1.5 2009-06-10 This is a maintenance release including several important bug fixes. This release is source and binary compatible with versions 1.3 and 1.4 of commons pool. In addition to resolving some important concurrency-related bugs (POOL-135, POOL-125, POOL-29 POOL-107) this release implements a fairness algorithm to ensure that threads waiting for available object instances from GenericObjectPools and GenericKeyedObjectPools are served in request arrival order.
1.4 2008-01-15 This is a maintenance release including numerous bug fixes. This release is source and binary compatible with version 1.3 of commons pool, but there are some behavior changes introduced to resolve bugs, remove ambiguity or improve robustness. Among these are the change in default behavior of GenericObjectPool and GenericKeyedObjectPool from FIFO back to LIFO queues (as in 1.2 and earlier). The LIFO/FIFO behavior is now configurable. Some of the extra synchronization included in version 1.3 was removed / refactored to improve performance. The javadoc has also been made more complete and explicit. See the detailed list of changes below for specifics on fixed bugs and behavior changes in Commons Pool 1.4. This version of Commons Pool depends only on JDK version 1.3 or higher. Classes implementing pools are all intended to be threadsafe.
1.3 2006-04-06 1.x bugfix release
1.2 2004-06-07 bugfixes
1.1 2003-10-20 bugfixes
1.0.1 2002-08-12  
1.0 2002-05-04  

Release 2.4 - 2015-05-27

Type Changes By
fix Fixed capacity leak when an object is offered from a GenericKeyedObjectPool while it is being validated by the evictor. Fixes POOL-287. Thanks to Caleb Spare and Thomas Neidhart. psteitz
fix Eliminated the requirement that objects managed by GenericObjectPool or GenericKeyedObjectPool be discernible by equals. Prior to this fix, equal but distinct object instances could not be stored in the same pool. Fixes POOL-283. psteitz
fix Eliminated the requirement that object equality and hashcodes do not change while objects are under management by GenericObjectPool or GenericKeyedObjectPool. Fixes POOL-284. psteitz
fix Fixed class loading for custom EvictionPolicy implementations that may not be present in the class loader hierarchy of the Pool classes by falling back to the class loader of the current class. Fixes POOL-289. Thanks to Luke Winkenbach. markt
fix Ensured that when an instance that has already been returned to a pool is returned again, the expected IllegalStateException is generated before the returning object is re-validated or re-passivated. Fixes POOL-285. psteitz
add Added preparePool method to GenericObjectPool. Fixes POOL-286. psteitz
update Update asm-util from 5.0.3 to 5.0.4. Fixes POOL-296. ggregory
update Exposed getEvictionPolicy as protected in BaseGenericObjectPool. Fixes POOL-293. psteitz

Release 2.3 - 2014-12-30

Type Changes By
fix Eliminated possibility that DefaultPoolObject#getIdleTimeMillis() could return a negative value. Use by pool implementations would not hit this bug. Fixes POOL-279. Thanks to Jacopo Cappellato. psteitz
fix Made wrapped BaseProxyHandler.pooledObject volatile. Fixes POOL-275. psteitz
fix Replace synchronisation with lock-free maxBorrowWaitTimeMillis to increase scalability. Fixes POOL-277. Thanks to Lucas Pouzac. ecki
fix Ensure that objects are not validated on borrow when testOnBorrow is set to false, testOnCreate is set to true and the pool is exhausted at the point borrowObject() is called. Fixes POOL-276. markt
fix Fixed error in GenericKeyedObjectPool constructor causing minEvictableIdleTimeMillis to be used in place of timeBetweenEvictionRunsMillis in eviction timer setup when a GenericKeyedObjectPoolConfig instance is supplied to the constructor. Fixes POOL-270. Thanks to Michael Berman. psteitz
fix Fix a threading issue that meant that concurrent calls to close() and returnObject() could result in some returned objects not being destroyed. Fixes POOL-263. markt
add Made fairness configurable for GenericObjectPool, GenericKeyedObjectPool. Fixes POOL-262. psteitz
fix Correctly mark cglib as an optional dependency and ensure that the OSGi manifest information reflects that. Fixes POOL-261. markt
fix Improve performance of statistics collection for pools that extend BaseGenericObjectPool. markt
fix Made client wait time statistics accurate when pools are configured to block indefinitely. Also modified computation to include latency clients experience due to waiting on factory methods. Fixes POOL-259. psteitz
update Update cglib to 3.1 from 3.0. Fixes POOL-273. ggregory
update Update asm-util to 5.0.3 from 4.0. Fixes POOL-274. ggregory
fix Prevent potential memory leaks when the Pool is dereferenced without being closed. markt
fix Prevent potential memory leaks with using an Evictor in a container environment. markt
fix Protect against a user provided eviction policy throwing an exception and stopping the Evictor thread. markt
fix Use the thread context class loader to load custom eviction policies. This allows application provided eviction policies to be used in a container environment when the pooling implementation is provided by the container. markt
fix Fix a potential infinite loop in the underlying Deque implementation. Fixes POOL-281. markt

Release 2.2 - 2014-02-24

Type Changes By
fix Ensure that if an attempt is made to return an object multiple times that the current active and idle object counts are not corrupted. Fixes POOL-248. Thanks to Warren Chen. markt
fix Fix Javadoc issues when building docs with Java 8. Fixes POOL-249. Thanks to Ville Skyttä. markt
fix Fix the remaining Javadoc warnings. markt
add Add a new validation configuration option testOnCreate that tests an object immediately after it is created. markt

Release 2.1 - 2013-12-30

Type Changes By
fix Added missing create counter decrement in GenericKeyedObjectPool create method on factory exception path. Prior to this fix, exceptions thrown by factory makeObject calls could leak per key capacity. Fixes POOL-243. Thanks to Michal Sabo. psteitz
fix Ensured that blocked threads waiting on a depleted pool get served when objects are destroyed due to validation or passivation failures in returnObject or when a checked out instance is invalidated. Fixes POOL-240. Thanks to Dan McNulty. psteitz
add Expand the coverage of the unit tests. Fixes POOL-241. Thanks to Bruno P. Kinoshita. markt
add Provide more control over the names under which Pools are registered in JMX so components using the pools can register the pools they use under a related name. markt
add Include the number of times an object has been borrowed from the Pool when the DefaultPooledObject wrapper is used and expose this property via JMX. markt
fix Remove a duplicate null check and fix some typos in PoolUtils. Fixes POOL-245. Thanks to Bruno P. Kinoshita. markt
fix Make the toString() method of ErodingKeyedObjectPool consistent with the other pools. Fixes POOL-246. Thanks to Bruno P. Kinoshita. markt
add Further expansion of the coverage of the unit tests. Fixes POOL-245. Thanks to Bruno P. Kinoshita. markt

Release 2.0 - 2013-11-11

Type Changes By
add Add support for proxy wrappers to ObjectPool and KeyedObjectPool. The primary advantage of these wrappers is that use of pooled objects is prevented after they have been returned to the pool. Fixes POOL-211. Thanks to Brad Koehn. markt
update Added abandoned object removal (moved from DBCP) to GenericObjectPool. Fixes POOL-229. psteitz
fix PooledObject.state does not need to be volatile Fixes POOL-221. markt
fix Suppress a FindBugs warning Fixes POOL-220. markt
update Use an IODH for PoolUtils.MIN_IDLE_TIMER Fixes POOL-217. Thanks to sebb. markt
update GenericKeyedObjectPool.ensureMinIdle(K) does not need to check getMinIdlePerKey(). Fixes POOL-216. markt
fix GenericKeyedObjectPool - multiple mutable fields not published safely. Fixes POOL-215. markt
fix GenericObjectPool.evictionPolicy not thread-safe Fixes POOL-214. markt
fix GenericObjectPool allows maxIdle < minIdle Fixes POOL-212. markt
fix GenericKeyedObjectPool.clear() has unnecessary null check of objectDequeue Fixes POOL-207. markt
fix Classes Generic[Keyed]ObjectPoolConfig are generic - but why? Fixes POOL-201. markt
fix GOP/GKOP don't consistently use getters to access fields Fixes POOL-200. markt
fix GOP/GKOP evict() method is not synchronised and is not thread-safe Fixes POOL-199. markt
fix PooledObject: risky init of lastBorrowTime & lastReturnTime Fixes POOL-197. markt
fix PooledObject.getActiveTimeMillis() does not synch. access to lastReturnTime and lastBorrowTime Fixes POOL-196. markt
update Replace synchronized blocks in PoolUtils with Read/Write locks. Fixes POOL-194. simonetripodi
update Support Java 1.5 Generics. Fixes POOL-83. simonetripodi
update Developer documentation and examples have to be updated once the 2.0 repackaging has been done Fixes POOL-186. simonetripodi
update Switch GOP to use a pooling mechanism based on java.util.concurrent and a LinkedBlockingQueue implementation from Apache Harmony (originally by Doug Lea and the JSR-166 expert group). markt
update Make deprecated protected attributes private, requiring that access is via the appropriate getters. markt
update Code clean-up. Add missing @Override annotations, remove unused code, remove deprecated code and unnecessary code. markt
update Introduce an Enum (WhenExhaustedAction) to control pool behaviour when no more objects are available to allocate. markt
update Remove WhenExhuastedAction.GROW since it is equivalent to WhenExhuastedAction.FAIL with a maxActive value of Integer.MAX_VALUE. markt
fix Remove confusing method PoolUtils.ErodingKeyedObjectPool.numIdle(K key). Fixes POOL-188. Thanks to sebb. markt
update Guard against multiple returns of the same object to the pool and ensure that only objects borrowed from the pool are returned to it. Fixes POOL-155. markt
fix Ensure GKOP.preparePool() throws an exception if no factory has been defined. Fixes POOL-150. markt
fix Add the ability to specify a per call wait time when borrowing an object. Fixes POOL-134. markt
fix Provide a name for the eviction timer thread. Fixes POOL-121. markt
update Remove setFactory() method from GOP. markt
fix Reduce duplication in configuration code. Fixes POOL-173. markt
fix Re-factor common code into common base classes. Fixes POOL-178. markt
update Expose GOP and GKOP attributes via JMX. Fixes POOL-172. markt
update Add additional attributes (also accessible via JMX) for monitoring. Fixes POOL-98. markt
update Change meaning of zero for maxWait to a maximum wait of zero milliseconds rather than the unexpected infinite wait. markt
fix Allow custom eviction policies to be defined. Fixes POOL-100. markt
add Add support for proxy wrappers for ObjectPool and KeyedObjectPool. The primary advantage of using these wrappers is that use of pooled objects is prevented after they have been returned to the pool. Fixes POOL-211. Thanks to Brad Koehn. markt

Release 1.6 - 2012-01-07

Type Changes By
add Support Java 1.5 Generics in version 1.x. Fixes POOL-208. ggregory

Release 1.5.7 - 2011-12-20

Type Changes By
fix Awaken threads waiting on borrowObject when a pool has been closed and have them throw IllegalStateException. Prior to the fix for this issue, threads waiting in borrowObject when close was invoked on GOP or GKOP would block indefinitely. Fixes POOL-189. Thanks to Bill Speirs. psteitz
fix Corrected total internal processing counter update in destroy. Prior to the fix for this issue, clear(key) was leaking capacity associated with elements in the pool being cleared. Fixes POOL-192. Thanks to Helge Dannenberg. psteitz

Release 1.5.6 - 2011-04-03

Type Changes By
fix Correctly handle an InterruptedException when waiting for an object from the pool. Fixes POOL-179. Thanks to Axel Grossmann. markt
fix Only stop tracking objects for a key when there are no idle objects, no active objects and no objects being processed. Fixes POOL-180. markt
update Make BaseObjectPool.isClosed() public. Fixes POOL-181. markt
fix Correct bug that could lead to inappropriate pool starvation when evict() and borrowObject() are called concurrently. Fixes POOL-184. Thanks to Adrian Nistor. markt
fix Fix performance issues when object destruction has latency. Thanks to psteitz. markt

Release 1.5.5 - 2010-09-10

Type Changes By
update In preparation for pool 2.0, deprecated direct access to protected fields and setFactory methods. In pool 2.0, pool object factories will be immutable. Fixes POOL-169. psteitz
fix Made GenericKeyedObjectPool._minIdle volatile. Fixes POOL-158. psteitz
fix Made the default context class loader for the eviction thread the same loader that loads the library to prevent memory leaks in multiple class loader environments. Fixes POOL-161. markt
update GenericKeyedObjectPool.destroy could use entrySet() rather than keySet() followed by get() Fixes POOL-166. sebb
fix GenericObjectPool and GenericKeyedObjectPool setFactory methods destroy idle instances in the pool by contract. Prior to the fix for this issue, newly set factories were being used to destroy idle instances, rather than the factories used to create them. The setFactory methods have also been deprecated, to be removed in version 2.0. Fixes POOL-157. Thanks to David Hu. psteitz
update ObjectPool classes can ignore Throwable. Added consistent handling for Throwables that are normally swallowed including always re-throwing certain Throwables (e.g. ThreadDeath). Fixes POOL-156. sebb
fix When waiting threads are interrupted, GOP, GKOP may leak capacity. Fixes POOL-162. markt
fix Documentation for the close method in GenericObjectPool and GenericKeyedObjectPool incorrectly states that this method does not clear the pool. Fixes POOL-154. Thanks to Glen Mazza. psteitz

Release 1.5.4 - 2009-11-20

Type Changes By
fix GenericObjectPool can block forever in borrowObject when the pool is exhausted and a newly created object fails validation. When borrowing an object if a new object is created but validate fails, the latch should not be returned to the queue as an exception will be thrown. Fixes POOL-152. Thanks to Bushov Alexander. markt

Release 1.5.3 - 2009-09-21

Type Changes By
fix Fix case where a thread could end up waiting indefinitely even if objects were available. Also fixes a couple of leaks in the internal processing object count that could lead to pool exhaustion. Fixes POOL-149. Thanks to Shuyang Zhou. markt

Release 1.5.2 - 2009-07-12

Type Changes By
fix Handle the case where one key has reached maxActive but other keys have not. Prior to the fix for this issue, threads waiting on objects from keyed pools still having instances available could be blocked by a thread requesting an instance from an exhausted pool. Fixes POOL-146. markt
fix Fix case where a thread could end up waiting indefinitely even if objects were available. Fixes POOL-147. Thanks to Giambattista Bloisi. markt
fix Ensure that the GenericKeyedObjectPool idle object evictor does not visit the same instance more than once per eviction run. Fixes POOL-145. markt

Release 1.5.1 - 2009-06-16

Type Changes By
fix When exhausted action is set to WHEN_EXHAUSTED_BLOCK, maxwait is positive and client threads time out waiting for idle objects, capacity can be "leaked" from GenericObjectPools and GeneritCkeyedObjectPools. Fixes POOL-144. markt

Release 1.5 - 2009-06-10

Type Changes By
fix StackKeyedObjectPool.getNumActive() needs to be synchronized. Fixes POOL-139. Thanks to Sebastian Bazley. markt
fix Inconsistent synchronization in GenericObjectPool; constant fields should be final. Fixes POOL-137. Thanks to Sebastian Bazley. markt
fix GenericObjectPool not FIFO with respect to borrowing threads. Fixes POOL-75. Thanks to Takayuki Kaneko and Gordon Mohr. markt
fix _numActive > _maxActive under load Fixes POOL-135. markt
fix Insufficient control over concurrent access to pooled objects by Evictor, client threads. Fixes POOL-125. markt
fix Number of connections created has crossed more than maxActive. Fixes POOL-107. markt
fix java.util.Timer in EvictionTimer does not recover from OutOfMemoryError in Evictor. Fixes POOL-122. markt
fix Failed object creation may result in invalid active count in GKOP. Fixes POOL-133. markt

Release 1.4 - 2008-01-15

Type Changes By
fix Fixed constructor which was ignoring maxTotal parameter: GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) sandymac
fix Changed StackKeyedObjectPool to discard stalest, not freshest, idle object when maxSleeping is reached. sandymac
fix Allowed blocked threads in GenericObjectPool borrowObject to be interrupted. Fixes POOL-102. Thanks to John Sumsion. psteitz
fix Fixes to address idle object eviction and LIFO/FIFO behavior reported in POOL-86. Made LIFO/FIFO behavior configurable for GenericObjectPool and GenericKeyedObjectPool, with default set back to LIFO (reverting to 1.2 behavior). Fixed GOP, GKOP evict method and added tests to ensure objects are visited in oldest-to-youngest order. Changed backing store for GOP, GKOP pools back to Commons Collections CursorableLinkedList (brought this class in, repackaged with package scope). Fixes POOL-86. psteitz
fix Changed the default setting for Config.softMinEvictableIdleTimeMillis to GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS (was being incorrectly defaulted to DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS). Fixes POOL-110. Thanks to Alexander Pogrebnyak. psteitz
fix Added a wrapper for the shared idle object eviction timer for all pools. The wrapper class wraps the Timer and keeps track of how many pools are using it. If no pools are using the timer, it is canceled. This prevents a thread being left running which, in application server environments, can lead to memory leaks and/or prevent applications from shutting down or reloading cleanly. Fixes POOL-97. Thanks to Mark Thomas. psteitz
fix Reduced synchronization in GenericObjectPool, GenericKeyedObjectPool. Factory method activations within synchronized blocks were causing performance problems in DBCP and other applications where factory methods could block. Fixes both POOL-93 and POOL-108. Fixes POOL-93. Thanks to Mark Thomas. psteitz
fix Made _testOnBorrow, _testOnReturn volatile and removed synchronization in associated getters and setters in GenericObjectPool, GenericKeyedObjectPool. Made getNumIdle synchronized in StackKeyedObjectPool. Fixes POOL-113. psteitz
fix Fixed an error in the GenericKeyedObjectPool constructor that takes a Config instance as a parameter. The minIdle setting in the Config was being ignored by the constructor. Fixes POOL-116. psteitz
fix Made behavior on instance validation failure consistent across pools, eliminating possible infinite loops in StackObjectPool, StackKeyedObjectPool, SoftReferenceObjectPool when factory fails to create valid objects. Fixes POOL-117.
update When no factory has been defined, addObject now throws IllegalStateExecption instead of NullPointerException for all pools. sandymac
update SoftReferenceObjectPool. Improved the accuracy of getNumIdle by "pruning" references to objects that have been garbage collected. sandymac
update GenericObjectPool, GenericKeyedObjectPool, SoftReferenceObjectPool, StackObjectPool. Eliminated IllegalStateExceptions when the following operations are attempted on a closed pool: getNumActive, getNumIdle, returnObject, invalidateObject. In each case, the operation is allowed to proceed, reporting the state of the pool that is being shut down, or destroying objects returning to the closed pool. sandymac
update StackObjectPool, SoftReferenceObjectPool, GenericKeyedObjectPool. Allowed borrowObject to continue (either examining additional idle instances or with makeObject) when an exception is encountered activating an idle object instead of propagating the exception to the client. Also made addObject propagate (not swallow) exceptions when passivating newly created instances. sandymac
update StackKeyedObjectPool. Added validation check for objects returned from borrowObject. psteitz
update BaseObjectPool, BaseKeyedObjectPool. Instead of throwing UnsupportedOperationException, the base class implementations of getNumIdle and getNumActive return negative values. The base implementation of close in BaseObjectPool no longer throws IllegalStateException when invoked on an already closed pool. sandymac

Release 1.3 - 2006-04-06

Type Changes By
fix A large number of bug fixes. See release notes for changes.

Release 1.2 - 2004-06-07

Type Changes By
fix GenericKeyedObjectPoolFactory Config Constructor is incorrect dirkv
fix Not possible to extend GenericObjectPool.returnObject() without affecting addObject() dirkv

Release 1.1 - 2003-10-20

Type Changes By
fix A lot of corner cases were fixed
fix Performance improvement by optimizing pool synchronization, the critical code paths were optimized by reducing pool synchronization but we also added more synchronization where needed
fix New minIdle feature: the minimum number of objects allowed in the pool before the evictor thread (if active) spawns new objects. (Note no objects are created when: numActive + numIdle >= maxActive)
fix New maxTotal feature: a cap on the total number of instances controlled by a pool. Only for GenericKeyedObjectPool where maxActive is a cap on the number of active instances from the pool (per key).
fix UML Class and sequence diagrams
fix See bugzilla for more changes

Release 1.0.1 - 2002-08-12

Type Changes By
fix No change log available.

Release 1.0 - 2002-05-04

Type Changes By
add No change log available.