Package org.apache.openjpa.jdbc.kernel
Class JDBCStoreManager.RefCountConnection
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingConnection
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.RefCountConnection
- All Implemented Interfaces:
AutoCloseable
,Connection
,Wrapper
,Closeable
- Enclosing class:
- JDBCStoreManager
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected Statement
createStatement
(boolean wrap) Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.protected Statement
createStatement
(int rsType, int rsConcur, boolean wrap) Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.void
free()
boolean
protected PreparedStatement
prepareStatement
(String sql, boolean wrap) Prepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement
, 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 aDelegatingPreparedStatement
, which is the default.void
ref()
void
setRetain
(boolean retain) Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingConnection
abort, appendInfo, clearWarnings, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStatement, createStruct, equals, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getDelegate, getHoldability, getInnermostDelegate, getMetaData, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, hashCode, isClosed, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, toString, unwrap
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
RefCountConnection
-
-
Method Details
-
getRetain
public boolean getRetain() -
setRetain
public void setRetain(boolean retain) -
ref
public void ref() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceConnection
- Overrides:
close
in classDelegatingConnection
- Throws:
SQLException
-
free
public void free() -
createStatement
Description copied from class:DelegatingConnection
Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.- Overrides:
createStatement
in classDelegatingConnection
- Throws:
SQLException
-
createStatement
Description copied from class:DelegatingConnection
Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.- Overrides:
createStatement
in classDelegatingConnection
- Throws:
SQLException
-
prepareStatement
Description copied from class:DelegatingConnection
Prepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement
, which is the default.- Overrides:
prepareStatement
in classDelegatingConnection
- 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 aDelegatingPreparedStatement
, which is the default.- Overrides:
prepareStatement
in classDelegatingConnection
- Throws:
SQLException
-