You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2009/05/14 00:44:48 UTC
svn commit: r774576 -
/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Author: markt
Date: Wed May 13 22:44:48 2009
New Revision: 774576
URL: http://svn.apache.org/viewvc?rev=774576&view=rev
Log:
Fix POOL-135 for GOP.
Modified:
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?rev=774576&r1=774575&r2=774576&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java Wed May 13 22:44:48 2009
@@ -1149,6 +1149,8 @@
} else {
_pool.addLast(new ObjectTimestampPair(obj));
}
+ _numActive--;
+ notifyAll();
}
}
}
@@ -1160,15 +1162,15 @@
} catch(Exception e) {
// ignored
}
- }
-
- // Decrement active count *after* destroy if applicable
- if (decrementNumActive) {
- synchronized(this) {
- _numActive--;
- notifyAll();
+ // Decrement active count *after* destroy if applicable
+ if (decrementNumActive) {
+ synchronized(this) {
+ _numActive--;
+ notifyAll();
+ }
}
}
+
}
public void close() throws Exception {
Re: svn commit: r774576 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Posted by Phil Steitz <ph...@gmail.com>.
Can you explain - maybe in the JIRA - what the problem is here and how
the change fixes it? I see there is a problem, but I am missing
something on the resolution.
Also, I think the first _numActive-- needs to be guarded by a
decrementNumActive test, else when addObjectToPool is called by
addObject, you will incorrectly decrement the active count. The fact
that no test failed after this change means either 1) I am missing
something or 2) we are missing tests on how addObject works with _numActive.
Phil
markt@apache.org wrote:
> Author: markt
> Date: Wed May 13 22:44:48 2009
> New Revision: 774576
>
> URL: http://svn.apache.org/viewvc?rev=774576&view=rev
> Log:
> Fix POOL-135 for GOP.
>
> Modified:
> commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
>
> Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
> URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?rev=774576&r1=774575&r2=774576&view=diff
> ==============================================================================
> --- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java (original)
> +++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java Wed May 13 22:44:48 2009
> @@ -1149,6 +1149,8 @@
> } else {
> _pool.addLast(new ObjectTimestampPair(obj));
> }
> + _numActive--;
> + notifyAll();
> }
> }
> }
> @@ -1160,15 +1162,15 @@
> } catch(Exception e) {
> // ignored
> }
> - }
> -
> - // Decrement active count *after* destroy if applicable
> - if (decrementNumActive) {
> - synchronized(this) {
> - _numActive--;
> - notifyAll();
> + // Decrement active count *after* destroy if applicable
> + if (decrementNumActive) {
> + synchronized(this) {
> + _numActive--;
> + notifyAll();
> + }
> }
> }
> +
> }
>
> public void close() throws Exception {
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org