Author: psteitz
Date: Sat Jul 21 13:19:21 2007
New Revision: 558377

URL: http://svn.apache.org/viewvc?view=rev&rev=558377
Log:
Added warning in GenericObjectPool returnObject javadoc about
dangers of multiple returns on same object.

JIRA: DBCP-94

Modified:
    
jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java

Modified: 
jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?view=diff&rev=558377&r1=558376&r2=558377
==============================================================================
--- 
jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
 (original)
+++ 
jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
 Sat Jul 21 13:19:21 2007
@@ -95,7 +95,7 @@
  * <p>
  * Optionally, one may configure the pool to examine and possibly evict 
objects as they
  * sit idle in the pool.  This is performed by an "idle object eviction" 
thread, which
- * runs asychronously.  The idle object eviction thread may be configured 
using the
+ * runs asynchronously.  The idle object eviction thread may be configured 
using the
  * following attributes:
  * <ul>
  *  <li>
@@ -958,6 +958,16 @@
         return _pool.size();
     }
 
+    /**
+     * [EMAIL PROTECTED]
+     * <p><strong>Note: </strong> There is no guard to prevent an object
+     * being returned to the pool multiple times. Clients are expected to
+     * discard references to returned objects and ensure that an object is not
+     * returned to the pool multiple times in sequence (i.e., without being
+     * borrowed again between returns). Violating this contract will result in
+     * the same object appearing multiple times in the pool and pool counters 
+     * (numActive, numIdle) returning incorrect values.</p>
+     */
     public synchronized void returnObject(Object obj) throws Exception {
         try {
             addObjectToPool(obj, true);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to