public class ManagedConnection extends DelegatingConnection
Constructor | Description |
---|---|
ManagedConnection(org.apache.commons.pool.ObjectPool pool,
TransactionRegistry transactionRegistry,
boolean accessToUnderlyingConnectionAllowed) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Closes the underlying connection, and close
any Statements that were not explicitly closed.
|
void |
commit() |
|
java.sql.Connection |
getDelegate() |
Returns my underlying
Connection . |
java.sql.Connection |
getInnermostDelegate() |
If my underlying
Connection is not a
DelegatingConnection, returns it,
otherwise recursively invokes this method on
my delegate. |
boolean |
isAccessToUnderlyingConnectionAllowed() |
If false, getDelegate() and getInnermostDelegate() will return null.
|
void |
rollback() |
|
void |
setAutoCommit(boolean autoCommit) |
|
void |
setReadOnly(boolean readOnly) |
printStackTrace
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
abort, clearWarnings, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, equals, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, hashCode, innermostDelegateEquals, isClosed, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setCatalog, setClientInfo, setClientInfo, setDelegate, setHoldability, setNetworkTimeout, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, toString, unwrap
public ManagedConnection(org.apache.commons.pool.ObjectPool pool, TransactionRegistry transactionRegistry, boolean accessToUnderlyingConnectionAllowed) throws java.sql.SQLException
java.sql.SQLException
public void close() throws java.sql.SQLException
DelegatingConnection
close
in class DelegatingConnection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in class DelegatingConnection
java.sql.SQLException
public java.sql.Connection getDelegate()
DelegatingConnection
Connection
.getDelegate
in class DelegatingConnection
Connection
.public java.sql.Connection getInnermostDelegate()
DelegatingConnection
Connection
is not a
DelegatingConnection, returns it,
otherwise recursively invokes this method on
my delegate.
Hence this method will return the first delegate that is not a DelegatingConnection, or null when no non-DelegatingConnection delegate can be found by traversing this chain.
This method is useful when you may have nested
DelegatingConnections, and you want to make
sure to obtain a "genuine" Connection
.
getInnermostDelegate
in class DelegatingConnection
public boolean isAccessToUnderlyingConnectionAllowed()
public void rollback() throws java.sql.SQLException
rollback
in class DelegatingConnection
java.sql.SQLException
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in class DelegatingConnection
java.sql.SQLException
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in class DelegatingConnection
java.sql.SQLException
Copyright © 2001-2004 Apache Software Foundation. Documenation generated April 15 2019.