org.apache.openjpa.jdbc.kernel
Class JDBCStoreManager.RefCountConnection

java.lang.Object
  extended by org.apache.openjpa.lib.jdbc.DelegatingConnection
      extended by org.apache.openjpa.jdbc.kernel.JDBCStoreManager.RefCountConnection
All Implemented Interfaces:
Connection, Closeable
Enclosing class:
JDBCStoreManager

protected class JDBCStoreManager.RefCountConnection
extends DelegatingConnection

Connection wrapper that keeps an internal ref count so that it knows when to really close.


Field Summary
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
JDBCStoreManager.RefCountConnection(Connection conn)
           
 
Method Summary
 void close()
           
protected  Statement createStatement(boolean wrap)
          Create a statement, with the option of not wrapping it in a DelegatingStatement, which is the default.
protected  Statement createStatement(int rsType, int rsConcur, boolean wrap)
          Create a statement, with the option of not wrapping it in a DelegatingStatement, which is the default.
 void free()
           
 boolean getRetain()
           
protected  PreparedStatement prepareStatement(String sql, boolean wrap)
          Prepare a statement, with the option of not wrapping it in a DelegatingPreparedStatement, which is the default.
protected  PreparedStatement prepareStatement(String sql, int rsType, int rsConcur, boolean wrap)
          Prepare a statement, with the option of not wrapping it in a DelegatingPreparedStatement, which is the default.
 void ref()
           
 void setRetain(boolean retain)
           
 
Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingConnection
appendInfo, clearWarnings, commit, createStatement, createStatement, createStatement, createStatement, equals, getAutoCommit, getCatalog, getDelegate, getHoldability, getInnermostDelegate, getMetaData, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, hashCode, isClosed, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareCall, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDBCStoreManager.RefCountConnection

public JDBCStoreManager.RefCountConnection(Connection conn)
Method Detail

getRetain

public boolean getRetain()

setRetain

public void setRetain(boolean retain)

ref

public void ref()

close

public void close()
           throws SQLException
Specified by:
close in interface Connection
Specified by:
close in interface Closeable
Overrides:
close in class DelegatingConnection
Throws:
SQLException

free

public void free()

createStatement

protected Statement createStatement(boolean wrap)
                             throws SQLException
Description copied from class: DelegatingConnection
Create a statement, with the option of not wrapping it in a DelegatingStatement, which is the default.

Overrides:
createStatement in class DelegatingConnection
Throws:
SQLException

createStatement

protected Statement createStatement(int rsType,
                                    int rsConcur,
                                    boolean wrap)
                             throws SQLException
Description copied from class: DelegatingConnection
Create a statement, with the option of not wrapping it in a DelegatingStatement, which is the default.

Overrides:
createStatement in class DelegatingConnection
Throws:
SQLException

prepareStatement

protected PreparedStatement prepareStatement(String sql,
                                             boolean wrap)
                                      throws SQLException
Description copied from class: DelegatingConnection
Prepare a statement, with the option of not wrapping it in a DelegatingPreparedStatement, which is the default.

Overrides:
prepareStatement in class DelegatingConnection
Throws:
SQLException

prepareStatement

protected PreparedStatement prepareStatement(String sql,
                                             int rsType,
                                             int rsConcur,
                                             boolean wrap)
                                      throws SQLException
Description copied from class: DelegatingConnection
Prepare a statement, with the option of not wrapping it in a DelegatingPreparedStatement, which is the default.

Overrides:
prepareStatement in class DelegatingConnection
Throws:
SQLException


Copyright © 2006 Apache Software Foundation. All Rights Reserved.