Commons Pool Changes

Release History

VersionDateDescription
1.62012-01-07Adds generics and requires Java 5.
1.5.72011-12-20This is a patch release, including bugfixes only.
1.5.62011-04-03This is a patch release, including bugfixes only.
1.5.52010-09-10This is a patch release, including bugfixes, documentation improvements and some deprecations in preparation for pool 2.0.
1.5.42009-11-20This is a patch release containing a fix for POOL-152, a regression introduced in version 1.5.
1.5.32009-09-21This is a patch release containing a fix for POOL-149, a regression introduced in version 1.5.
1.5.22009-07-12This is a patch release containing fixes for POOL-146 and POOL-147, regressions introduced in version 1.5.
1.5.12009-06-16This is a patch release containing a fix for POOL-144, a regression introduced in version 1.5.
1.52009-06-10This 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.42008-01-15This 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.32006-04-061.x bugfix release
1.22004-06-07bugfixes
1.12003-10-20bugfixes
1.0.12002-08-12 
1.02002-05-04 

Release 1.6 - 2012-01-07

TypeChangesBy

add

Support Java 1.5 Generics in version 1.x. Fixes POOL-208.ggregory

Release 1.5.7 - 2011-12-20

TypeChangesBy

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

TypeChangesBy

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.markt

fix

Fix performance issues when object destruction has latency. Thanks to psteitz.markt

Release 1.5.5 - 2010-09-10

TypeChangesBy

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

TypeChangesBy

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

TypeChangesBy

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

TypeChangesBy

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

TypeChangesBy

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

TypeChangesBy

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

TypeChangesBy

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

TypeChangesBy

fix

A large number of bug fixes. See release notes for changes.

Release 1.2 - 2004-06-07

TypeChangesBy

fix

GenericKeyedObjectPoolFactory Config Constructor is incorrectdirkv

fix

Not possible to extend GenericObjectPool.returnObject() without affecting addObject()dirkv

Release 1.1 - 2003-10-20

TypeChangesBy

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

TypeChangesBy

fix

No change log available.

Release 1.0 - 2002-05-04

TypeChangesBy

add

No change log available.