[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    svn commit: r1563249 - /commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableCon
From:       markt () apache ! org
Date:       2014-01-31 20:29:38
Message-ID: 20140131202938.272A22388A9B () eris ! apache ! org
[Download RAW message or body]

Author: markt
Date: Fri Jan 31 20:29:37 2014
New Revision: 1563249

URL: http://svn.apache.org/r1563249
Log:
Clean-up some TODOs. Pool 2 provides the necessary guards.

Modified:
    commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java


Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
                
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java?rev=1563249&r1=1563248&r2=1563249&view=diff
 ==============================================================================
--- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java \
                (original)
+++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java \
Fri Jan 31 20:29:37 2014 @@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.commons.dbcp2;
 
 import java.sql.Connection;
@@ -33,7 +32,6 @@ import org.apache.commons.pool2.ObjectPo
  */
 public class PoolableConnection extends DelegatingConnection<Connection> {
     /** The pool to which I should return. */
-    // TODO: Correct use of the pool requires that this connection is only every \
returned to the pool once.  protected ObjectPool<PoolableConnection> _pool = null;
 
     /**
@@ -63,7 +61,7 @@ public class PoolableConnection extends 
             isUnderlyingConectionClosed = getDelegateInternal().isClosed();
         } catch (SQLException e) {
             try {
-                _pool.invalidateObject(this); // XXX should be guarded to happen at \
most once +                _pool.invalidateObject(this);
             } catch(IllegalStateException ise) {
                 // pool is closed, so close the connection
                 passivate();
@@ -78,7 +76,7 @@ public class PoolableConnection extends 
             // Normal close: underlying connection is still open, so we
             // simply need to return this proxy to the pool
             try {
-                _pool.returnObject(this); // XXX should be guarded to happen at most \
once +                _pool.returnObject(this);
             } catch(IllegalStateException e) {
                 // pool is closed, so close the connection
                 passivate();
@@ -94,7 +92,7 @@ public class PoolableConnection extends 
             // Abnormal close: underlying connection closed unexpectedly, so we
             // must destroy this proxy
             try {
-                _pool.invalidateObject(this); // XXX should be guarded to happen at \
most once +                _pool.invalidateObject(this);
             } catch(IllegalStateException e) {
                 // pool is closed, so close the connection
                 passivate();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic