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 PoolablePreparedStatement.java
Date Sun, 07 Mar 2004 10:50:37 GMT
dirkv       2004/03/07 02:50:37

  Modified:    dbcp/src/java/org/apache/commons/dbcp
                        PoolablePreparedStatement.java
  Log:
  minor fixes needed to get prepared statements pooled accross a connection close
  
  Revision  Changes    Path
  1.11      +9 -3      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolablePreparedStatement.java
  
  Index: PoolablePreparedStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolablePreparedStatement.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PoolablePreparedStatement.java	28 Feb 2004 12:18:17 -0000	1.10
  +++ PoolablePreparedStatement.java	7 Mar 2004 10:50:37 -0000	1.11
  @@ -59,6 +59,12 @@
           super((DelegatingConnection) conn, stmt);
           _pool = pool;
           _key = key;
  +
  +        // Remove from trace now because this statement will be 
  +        // added by the activate method.
  +        if(_conn != null) {
  +            _conn.removeTrace(this);
  +        }
       }
   
       /**
  @@ -85,7 +91,7 @@
           if(_conn != null) {
               _conn.addTrace(this);
           }
  -        super.passivate();
  +        super.activate();
       }
     
       protected void passivate() throws SQLException {
  @@ -93,7 +99,7 @@
           if(_conn != null) {
               _conn.removeTrace(this);
           }
  -           
  +
           // The JDBC spec requires that a statment close any open
           // ResultSet's when it is closed.
           // FIXME The PreparedStatement we're wrapping should handle this for us.
  
  
  

---------------------------------------------------------------------
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