/** * Constructor. * * @param stmt the underlying {@link CallableStatement} * @param key the key for this statement in the {@link KeyedObjectPool} * @param pool the {@link KeyedObjectPool} from which this CallableStatement was obtained * @param conn the {@link Connection} that created this CallableStatement */ public PoolableCallableStatement(CallableStatement stmt, Object key, KeyedObjectPool pool, Connection conn) { 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); } }
/** * Constructor. * * @param stmt the underlying {@link CallableStatement} * @param key the key for this statement in the {@link KeyedObjectPool} * @param pool the {@link KeyedObjectPool} from which this CallableStatement was obtained * @param conn the {@link Connection} that created this CallableStatement */ public PoolableCallableStatement(CallableStatement stmt, Object key, KeyedObjectPool pool, Connection conn) { 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); } }
/** * Constructor * @param stmt my underlying {@link PreparedStatement} * @param key my key" as used by {@link KeyedObjectPool} * @param pool the {@link KeyedObjectPool} from which I was obtained. * @param conn the {@link Connection} from which I was created */ public PoolablePreparedStatement(PreparedStatement stmt, Object key, KeyedObjectPool pool, Connection conn) { 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); } }
/** * Constructor * @param stmt my underlying {@link PreparedStatement} * @param key my key" as used by {@link KeyedObjectPool} * @param pool the {@link KeyedObjectPool} from which I was obtained. * @param conn the {@link Connection} from which I was created */ public PoolablePreparedStatement(PreparedStatement stmt, Object key, KeyedObjectPool pool, Connection conn) { 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); } }
/** * Constructor * @param stmt my underlying {@link PreparedStatement} * @param key my key" as used by {@link KeyedObjectPool} * @param pool the {@link KeyedObjectPool} from which I was obtained. * @param conn the {@link Connection} from which I was created */ public PoolablePreparedStatement(PreparedStatement stmt, Object key, KeyedObjectPool pool, Connection conn) { 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); } }
protected void passivate() throws SQLException { _closed = true; 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. // See bug 17301 for what could happen when ResultSets are closed twice. List resultSets = getTrace(); if( resultSets != null) { ResultSet[] set = (ResultSet[]) resultSets.toArray(new ResultSet[resultSets.size()]); for (int i = 0; i < set.length; i++) { set[i].close(); } clearTrace(); } super.passivate(); }
/** * Passivates to prepare for return to the pool. Removes the trace associated with this CallableStatement * from the Connection that created it. Also closes any associated ResultSets. */ protected void passivate() throws SQLException { _closed = true; 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. // See DBCP-10 for what could happen when ResultSets are closed twice. List resultSets = getTrace(); if(resultSets != null) { ResultSet[] set = (ResultSet[])resultSets.toArray(new ResultSet[resultSets.size()]); for(int i = 0; i < set.length; i++) { set[i].close(); } clearTrace(); } super.passivate(); }
/** * Passivates to prepare for return to the pool. Removes the trace associated with this CallableStatement * from the Connection that created it. Also closes any associated ResultSets. */ protected void passivate() throws SQLException { _closed = true; 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. // See DBCP-10 for what could happen when ResultSets are closed twice. List resultSets = getTrace(); if(resultSets != null) { ResultSet[] set = (ResultSet[])resultSets.toArray(new ResultSet[resultSets.size()]); for(int i = 0; i < set.length; i++) { set[i].close(); } clearTrace(); } super.passivate(); }
try { if (_conn != null) { _conn.removeTrace(this); _conn = null;
try { if (_conn != null) { _conn.removeTrace(this); _conn = null;
protected void passivate() throws SQLException { _closed = true; 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. // See bug 17301 for what could happen when ResultSets are closed twice. List resultSets = getTrace(); if( resultSets != null) { ResultSet[] set = (ResultSet[]) resultSets.toArray(new ResultSet[resultSets.size()]); for (int i = 0; i < set.length; i++) { set[i].close(); } clearTrace(); } if (batchAdded) { clearBatch(); } super.passivate(); }
try { if (_conn != null) { _conn.removeTrace(this); _conn = null;
protected void passivate() throws SQLException { _closed = true; 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. // See bug 17301 for what could happen when ResultSets are closed twice. List resultSets = getTrace(); if( resultSets != null) { ResultSet[] set = (ResultSet[]) resultSets.toArray(new ResultSet[resultSets.size()]); for (int i = 0; i < set.length; i++) { set[i].close(); } clearTrace(); } if (batchAdded) { clearBatch(); } super.passivate(); }