commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hauke Rabe (JIRA)" <>
Subject [jira] Created: (POOL-106) Usage of System.currentTimeMillis() as key for a TreeMap
Date Tue, 16 Oct 2007 06:29:51 GMT
Usage of System.currentTimeMillis() as key for a TreeMap

                 Key: POOL-106
             Project: Commons Pool
          Issue Type: Bug
    Affects Versions: 1.3
            Reporter: Hauke Rabe

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.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message