commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1173881 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Date Wed, 21 Sep 2011 21:48:15 GMT
Author: psteitz
Date: Wed Sep 21 21:48:15 2011
New Revision: 1173881

URL: http://svn.apache.org/viewvc?rev=1173881&view=rev
Log:
Wait to invalidate instance to be destroyed until we have removed it from the pool; otherwise
a client could have already grabbed it. Saw this once in testClearOldest.

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1173881&r1=1173880&r2=1173881&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Wed Sep 21 21:48:15 2011
@@ -1343,7 +1343,6 @@ public class GenericKeyedObjectPool<K,T>
             throws Exception {
         
         register(key);
-        toDestroy.invalidate();
 
         try {
             ObjectDeque<T> objectDeque = poolMap.get(key);
@@ -1351,6 +1350,7 @@ public class GenericKeyedObjectPool<K,T>
             
             if (isIdle || always) {
                 objectDeque.getAllObjects().remove(toDestroy.getObject());
+                toDestroy.invalidate();
         
                 try {
                     _factory.destroyObject(key, toDestroy.getObject());



Mime
View raw message