commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp AbandonedObjectPool.java
Date Sun, 25 Apr 2004 09:53:48 GMT
dirkv       2004/04/25 02:53:48

  Modified:    dbcp/src/java/org/apache/commons/dbcp
                        AbandonedObjectPool.java
  Log:
  Bugzilla Bug 28579: NumActive can become incorrect when removeAbandoned=true
  (patch from Wayne Woodfield)
  
  Revision  Changes    Path
  1.14      +9 -3      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/AbandonedObjectPool.java
  
  Index: AbandonedObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/AbandonedObjectPool.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AbandonedObjectPool.java	28 Feb 2004 11:48:04 -0000	1.13
  +++ AbandonedObjectPool.java	25 Apr 2004 09:53:48 -0000	1.14
  @@ -91,7 +91,10 @@
       public void returnObject(Object obj) throws Exception {
           if (config != null && config.getRemoveAbandoned()) {
               synchronized(trace) {
  -                trace.remove(obj);
  +                boolean foundObject = trace.remove(obj);
  +                if (!foundObject) {
  +                    return; // This connection has already been invalidated.  Stop now.
  +                }
               }
           }
           super.returnObject(obj);
  @@ -100,7 +103,10 @@
       public void invalidateObject(Object obj) throws Exception {
           if (config != null && config.getRemoveAbandoned()) {
               synchronized(trace) {
  -                trace.remove(obj);
  +                boolean foundObject = trace.remove(obj);
  +                if (!foundObject) {
  +                    return; // This connection has already been invalidated.  Stop now.
  +                }
               }
           }
           super.invalidateObject(obj);        
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message