Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.3
-
None
Description
In the method 'clearOldest' of GenericKeyedObjectPool the class ObjectTimestampPair is used as keys for a TreeMap wich compares the elements by System.currentTimeMillis().
If two ObjectTimestampPair instances have the same timestamp the value in the map will be overridden and the wrong instance will be destroyed.
If you use the pool with hibernate it will be result in a Statement already close Exception.
As a patch i return never zero in the compareTo method of ObjectTimestampPair.