Class ClientConnection
java.lang.Object
org.apache.derby.client.am.ClientConnection
- All Implemented Interfaces:
AutoCloseable, Connection, Wrapper, ConnectionCallbackInterface
- Direct Known Subclasses:
NetConnection
public abstract class ClientConnection
extends Object
implements Connection, ConnectionCallbackInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanbooleanprivate booleanprivate intint(package private) final WeakHashMap<UnitOfWorkListener, Void> private StringCached copy of the schema name.private intThe default isolation level, enforced on connection resets.private static Stringprivate static Stringprivate static Stringprivate static Stringprivate intprivate static final Stringprotected EncryptionManagerprivate ClientPreparedStatementprivate intHoldabilty for created statements.protected booleanprivate static final intprivate intCached copy of the isolation level.private final HashMap<String, ClientPreparedStatement> protected booleanprivate booleanprivate CallableLocatorProceduresReference to object with prepared statements for calling the locator procedures.private intprotected boolean(package private) final WeakHashMap<ClientStatement, Void> intboolean(package private) booleanprivate static final intConstant indicating that isolation_ has not been updated through piggy-backing, (or that the previously stored value was invalidated, e.g. by an XA state change).private intprotected final Stringprivate SqlWarningstatic final intXA_T0_NOT_ASSOCIATEDThis connection is not currently associated with an XA transaction In this state commits will flow in autocommit mode.static final intXA_T1_ASSOCIATEDIn this state commits will not flow in autocommit mode.intprivate intFields inherited from interface Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClientConnection(LogWriter logWriter, boolean isXAConn, BasicClientDataSource40 dataSource) protectedClientConnection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties) protectedClientConnection(LogWriter logWriter, String user, String password, boolean isXAConn, BasicClientDataSource40 dataSource) protectedClientConnection(LogWriter logWriter, String user, String password, BasicClientDataSource40 dataSource) -
Method Summary
Modifier and TypeMethodDescriptionvoid(package private) void(package private) voidprivate voidprotected abstract booleanprotected abstract booleanprotected voidBegin aborting the connectionprotected voidprivate void(package private) voidCheck if the transaction is in progress and the connection cannot be closed.voidprivate voidvoidclose()(package private) voidcloseForReuse(boolean statementPooling) voidprivate voidprivate voidcloseX()voidcommit()voidvoidRollback the UnitOfWorkListener specifically.voidfinal voidvoidcompleteInitialPiggyBackIsolation(int pbIsolation) Sets the default isolation level of the connection upon connection initialization.voidcompleteInitialPiggyBackSchema(String pbSchema) Sets the current schema upon connection initialization.voidvoidvoidcompletePiggyBackIsolation(int pbIsolation) Completes piggy-backing of the new current isolation level by updating the cached copy in am.Connection.voidcompletePiggyBackSchema(String pbSchema) Completes piggy-backing of the new current schema by updating the cached copy in am.Connection.protected voidcompleteReset(boolean isDeferredReset, boolean closeStatementsOnClose, NetXAResource xares)
NOTE:The following comments are valid for the changes done as part of implementing statement caching only (see DERBY-3313 and linked issues).private voidRollback the specific UnitOfWorkListener.voidcompleteSqlca(Sqlca sqlca) (package private) voidConstructs an object that implements theBlobinterface.Constructs an object that implements theClobinterface.createStatement(int resultSetType, int resultSetConcurrency) createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) private ClientStatementcreateStatementX(int resultSetType, int resultSetConcurrency, int resultSetHoldability) protected abstract booleanprivate intdowngradeResultSetType(int resultSetType) protected voidfinalize()booleanprivate voidprivate voidprotected voidbooleanReturns the current schema (the schema that would be used for compilation.intintGet the name of the current schema.intintReturns the ID of the active transaction for this connection.intintint(package private) final intReturn the holdabilty for the Connection.private voidinitConnection(LogWriter logWriter, BasicClientDataSource40 dataSource) booleanReturn true if the connection is abortingbooleanisClosed()booleanprotected abstract booleanbooleanReturn true if the physical connection is still open.booleanbooleanvoid(package private) CallableLocatorProceduresGet handle to the object that contains prepared statements for calling locator procedures for this connection.private voidmarkClosed(boolean statementPooling) protected abstract voidprivate voidmarkClosedForReuse(boolean statementPooling) private void(package private) StringnativeSQLX(String sql) protected abstract AgentnewAgent_(LogWriter logWriter, int loginTimeout, String serverName, int portNumber, int clientSSLMode) protected abstract ClientCallableStatementnewCallableStatement_(String sql, int type, int concurrency, int holdability) protected abstract ClientDatabaseMetaDataprotected abstract ClientPreparedStatementnewPositionedUpdatePreparedStatement_(String sql, Section section) protected abstract ClientPreparedStatementnewPreparedStatement_(String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) abstract SectionManagernewSectionManager(Agent agent) protected abstract ClientStatementnewStatement_(int type, int concurrency, int holdability) prepareCall(String sql) prepareCall(String sql, int resultSetType, int resultSetConcurrency) prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) (package private) ClientCallableStatementprepareCallX(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) (package private) ClientPreparedStatement(package private) ClientCallableStatementprepareMessageProc(String sql) (package private) ClientPreparedStatementpreparePositionedUpdateStatement(String sql, Section querySection) prepareStatement(String sql) prepareStatement(String sql, int autoGeneratedKeys) prepareStatement(String sql, int[] columnIndexes) prepareStatement(String sql, int resultSetType, int resultSetConcurrency) prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql, String[] columnNames) (package private) ClientPreparedStatementprepareStatementX(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) (package private) voidprivate void(package private) voidabstract voidabstract voidabstract voidabstract voidabstract voidabstract voidprivate voidvoidprotected abstract voidprotected abstract voidvoidreleaseSavepoint(Savepoint savepoint) voidprotected abstract voidprotected abstract voidresetCallableStatement_(ClientCallableStatement cs, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) protected voidresetConnection(LogWriter logWriter) protected voidprotected abstract voidresetPreparedStatement_(ClientPreparedStatement ps, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) protected voidprotected voidprotected abstract voidresetStatement_(ClientStatement statement, int type, int concurrency, int holdability) voidrollback()voidprotected abstract booleanChecks whether the server supports locators for large objects.protected abstract booleanReturn true if the server supports nanoseconds in timestampsvoidsetAutoCommit(boolean autoCommit) voidsetCatalog(String catalog) voidsetHoldability(int holdability) voidsetNetworkTimeout(Executor executor, int milliseconds) voidsetReadOnly(boolean readOnly) setSavepoint(String name) private ClientSavepointsetSavepointX(ClientSavepoint savepoint) voidSet the default schema for the Connection.voidsetTransactionIsolation(int level) private voidsetTransactionIsolationX(int level) Set the transaction isolation level as specified.voidsetTypeMap(Map map) voidsetXAState(int state) protected abstract booleanFinds out if the underlaying database connection supports session data caching.booleanCheck if there are uncommitted operations in the current transaction that prevent us from closing the connection.private inttranslateIsolation(String isolationStr) Translates the isolation level from a SQL string to the JDBC int valueboolean(package private) voidprivate void(package private) voidabstract voidabstract voidabstract voidabstract voidabstract voidabstract voidprivate voidvoidwriteTransactionStart(ClientStatement statement) protected abstract voidprotected abstract voidprotected abstract voidwriteXATransactionStart(ClientStatement statement) Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Connection
beginRequest, createArrayOf, createNClob, createSQLXML, createStruct, endRequest, getClientInfo, getClientInfo, isValid, setClientInfo, setClientInfo, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValidMethods inherited from interface Wrapper
isWrapperFor, unwrap
-
Field Details
-
agent_
-
databaseMetaData_
-
openStatements_
-
CommitAndRollbackListeners_
-
warnings_
-
INVALID_LOCATOR
private static final int INVALID_LOCATOR- See Also:
-
user_
-
retrieveMessageText_
boolean retrieveMessageText_ -
jdbcReadOnly_
private boolean jdbcReadOnly_ -
holdability
private int holdabilityHoldabilty for created statements. Only access through the holdability method to ensure the correct value is returned for an XA connection. -
databaseName_
-
productID_
-
encryptionManager_
-
isolationLevelPreparedStmts
-
getTransactionIsolationPrepStmt
-
open_
protected boolean open_ -
aborting_
private boolean aborting_ -
availableForReuse_
private boolean availableForReuse_ -
TRANSACTION_UNKNOWN
private static final int TRANSACTION_UNKNOWNConstant indicating that isolation_ has not been updated through piggy-backing, (or that the previously stored value was invalidated, e.g. by an XA state change).- See Also:
-
isolation_
private int isolation_Cached copy of the isolation level. Kept in sync with server through piggy-backing. -
defaultIsolation
private int defaultIsolationThe default isolation level, enforced on connection resets.Note that this value may be changed upon connection initialization in the future, as the server can piggy-back the isolation level.
-
currentSchemaName_
Cached copy of the schema name. Updated through piggy-backing and used to implement statement caching. -
autoCommit_
public boolean autoCommit_ -
inUnitOfWork_
protected boolean inUnitOfWork_ -
accumulated440ForMessageProcFailure_
private boolean accumulated440ForMessageProcFailure_ -
accumulated444ForMessageProcFailure_
private boolean accumulated444ForMessageProcFailure_ -
transactionID_
private int transactionID_ -
isXAConnection_
protected boolean isXAConnection_ -
XA_T0_NOT_ASSOCIATED
public static final int XA_T0_NOT_ASSOCIATEDXA_T0_NOT_ASSOCIATEDThis connection is not currently associated with an XA transaction In this state commits will flow in autocommit mode.- See Also:
-
XA_T1_ASSOCIATED
public static final int XA_T1_ASSOCIATEDXA_T1_ASSOCIATEDIn this state commits will not flow in autocommit mode.- See Also:
-
xaState_
private int xaState_ -
xaHostVersion_
public int xaHostVersion_ -
loginTimeout_
private int loginTimeout_ -
dataSource_
-
serverNameIP_
-
portNumber_
public int portNumber_ -
clientSSLMode_
private int clientSSLMode_ -
clientCursorNameCache_
-
commBufferSize_
public int commBufferSize_ -
resetConnectionAtFirstSql_
public boolean resetConnectionAtFirstSql_ -
DERBY_TRANSACTION_REPEATABLE_READ
-
DERBY_TRANSACTION_SERIALIZABLE
-
DERBY_TRANSACTION_READ_COMMITTED
-
DERBY_TRANSACTION_READ_UNCOMMITTED
-
dncGeneratedSavepointId_
private int dncGeneratedSavepointId_ -
dncGeneratedSavepointNamePrefix__
- See Also:
-
lobProcs
Reference to object with prepared statements for calling the locator procedures. Makes it possible to reuse prepared statements within the connection.
-
-
Constructor Details
-
ClientConnection
protected ClientConnection(LogWriter logWriter, String user, String password, BasicClientDataSource40 dataSource) throws SqlException - Throws:
SqlException
-
ClientConnection
protected ClientConnection(LogWriter logWriter, String user, String password, boolean isXAConn, BasicClientDataSource40 dataSource) throws SqlException - Throws:
SqlException
-
ClientConnection
protected ClientConnection(LogWriter logWriter, boolean isXAConn, BasicClientDataSource40 dataSource) throws SqlException - Throws:
SqlException
-
ClientConnection
protected ClientConnection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties) throws SqlException - Throws:
SqlException
-
-
Method Details
-
initConnection
private void initConnection(LogWriter logWriter, BasicClientDataSource40 dataSource) throws SqlException - Throws:
SqlException
-
resetConnection
- Throws:
SqlException
-
finalize
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
preparePositionedUpdateStatement
ClientPreparedStatement preparePositionedUpdateStatement(String sql, Section querySection) throws SqlException - Throws:
SqlException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareDynamicCatalogQuery
- Throws:
SqlException
-
nativeSQL
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
nativeSQLX
- Throws:
SqlException
-
allowLocalCommitRollback_
- Throws:
SqlException
-
setAutoCommit
- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
getAutoCommit
- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
commit
- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
checkForInvalidXAStateOnCommitOrRollback
- Throws:
SqlException
-
flowCommit
- Throws:
SqlException
-
flowAutoCommit
- Throws:
SqlException
-
willAutoCommitGenerateFlow
- Throws:
SqlException
-
writeAutoCommit
- Throws:
SqlException
-
writeCommit
- Throws:
SqlException
-
readAutoCommit
- Throws:
SqlException
-
readCommit
- Throws:
SqlException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
flowRollback
- Throws:
SqlException
-
writeRollback
- Throws:
SqlException
-
readRollback
- Throws:
SqlException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException
-
checkForTransactionInProgress
Check if the transaction is in progress and the connection cannot be closed.- Throws:
SqlException- if the connection cannot be closed because the transaction is active
-
transactionInProgress
public boolean transactionInProgress()Check if there are uncommitted operations in the current transaction that prevent us from closing the connection.- Returns:
trueif the connection cannot be closed due to uncommitted operations in the transaction
-
closeX
- Throws:
SQLException
-
closeResources
- Throws:
SQLException
-
closeResourcesX
- Throws:
SQLException
-
isGlobalPending_
protected abstract boolean isGlobalPending_() -
closeForReuse
- Throws:
SqlException
-
flowClose
- Throws:
SqlException
-
markClosed_
protected abstract void markClosed_() -
markClosed
private void markClosed(boolean statementPooling) -
markClosedForReuse
private void markClosedForReuse(boolean statementPooling) -
markStatementsClosed
private void markStatementsClosed() -
writeCloseStatements
- Throws:
SqlException
-
readCloseStatements
- Throws:
SqlException
-
isPhysicalConnClosed
public boolean isPhysicalConnClosed()Return true if the physical connection is still open. Might be logically closed but available for reuse.- Returns:
- true if physical connection still open
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceConnection
-
isClosedX
public boolean isClosedX() -
setTransactionIsolation
- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
setTransactionIsolationX
Set the transaction isolation level as specified.If this method is called during a transaction, the result is implementation-defined.
Information about Derby specific isolation level handling:
- REPEATABLE_READ = JDBC: TRANSACTION_SERIALIZABLE, DERBY: RR, PROTOCOL: repeatable read
- READ_STABILITY = JDBC: TRANSACTION_REPEATABLE_READ, DERBY: RS, PROTOCOL: All
- CURSOR_STABILITY = JDBC: TRANSACTION_READ_COMMITTED, DERBY: CS, PROTOCOL: Cursor stability
- UNCOMMITTED_READ = JDBC: TRANSACTION_READ_UNCOMMITTED, DERBY: UR, PROTOCOL: Change
- NO_COMMIT = JDBC: TRANSACTION_NONE, DERBY: NC, PROTOCOL: No commit
- Throws:
SqlException
-
supportsSessionDataCaching
protected abstract boolean supportsSessionDataCaching()Finds out if the underlaying database connection supports session data caching.- Returns:
- true if sessionData is supported
-
serverSupportsLocators
protected abstract boolean serverSupportsLocators()Checks whether the server supports locators for large objects. Note that even though the server supports LOB locators, the database that is accessed through the server may not have the necessary stored procedures to support LOB locators (e.g., because the database is soft upgraded from an earlier version).- Returns:
trueif LOB locators are supported.
-
serverSupportsTimestampNanoseconds
protected abstract boolean serverSupportsTimestampNanoseconds()Return true if the server supports nanoseconds in timestamps -
getTransactionIsolation
- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getTransactionIsolationX
- Throws:
SQLException
-
getTransactionID
public int getTransactionID()Returns the ID of the active transaction for this connection.- Returns:
- the ID of the active transaction
-
getCurrentSchemaName
Returns the current schema (the schema that would be used for compilation. This is not part of the java.sql.Connection interface, and is only intended for use with statement caching.- Returns:
- the name of the current schema
- Throws:
SQLException
-
translateIsolation
Translates the isolation level from a SQL string to the JDBC int value- Parameters:
isolationStr- SQL isolation string- Returns:
- isolation level as a JDBC integer value
-
getWarnings
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
clearWarningsX
- Throws:
SqlException
-
getMetaData
- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException
-
setReadOnly
- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareMessageProc
- Throws:
SqlException
-
downgradeResultSetType
private int downgradeResultSetType(int resultSetType) -
getTypeMap
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
setHoldability
- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
getHoldability
- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepointX
- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatementX
private ClientStatement createStatementX(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SqlException - Throws:
SqlException
-
resetStatement
- Throws:
SqlException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatementX
ClientPreparedStatement prepareStatementX(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) throws SqlException - Throws:
SqlException
-
resetPrepareStatement
- Throws:
SqlException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCallX
ClientCallableStatement prepareCallX(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SqlException - Throws:
SqlException
-
resetPrepareCall
- Throws:
SqlException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
allowCloseInUOW_
protected abstract boolean allowCloseInUOW_() -
doCloseStatementsOnClose_
protected abstract boolean doCloseStatementsOnClose_() -
newSectionManager
-
newAgent_
protected abstract Agent newAgent_(LogWriter logWriter, int loginTimeout, String serverName, int portNumber, int clientSSLMode) throws SqlException - Throws:
SqlException
-
newDatabaseMetaData_
-
newStatement_
protected abstract ClientStatement newStatement_(int type, int concurrency, int holdability) throws SqlException - Throws:
SqlException
-
resetStatement_
protected abstract void resetStatement_(ClientStatement statement, int type, int concurrency, int holdability) throws SqlException - Throws:
SqlException
-
newPositionedUpdatePreparedStatement_
protected abstract ClientPreparedStatement newPositionedUpdatePreparedStatement_(String sql, Section section) throws SqlException - Throws:
SqlException
-
newPreparedStatement_
protected abstract ClientPreparedStatement newPreparedStatement_(String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) throws SqlException - Throws:
SqlException
-
resetPreparedStatement_
protected abstract void resetPreparedStatement_(ClientPreparedStatement ps, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes) throws SqlException - Throws:
SqlException
-
newCallableStatement_
protected abstract ClientCallableStatement newCallableStatement_(String sql, int type, int concurrency, int holdability) throws SqlException - Throws:
SqlException
-
resetCallableStatement_
protected abstract void resetCallableStatement_(ClientCallableStatement cs, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SqlException - Throws:
SqlException
-
completeConnect
- Throws:
SqlException
-
writeCommitSubstitute_
- Throws:
SqlException
-
readCommitSubstitute_
- Throws:
SqlException
-
writeLocalXAStart_
- Throws:
SqlException
-
readLocalXAStart_
- Throws:
SqlException
-
writeLocalXACommit_
- Throws:
SqlException
-
writeXACommit_
- Throws:
SqlException
-
readLocalXACommit_
- Throws:
SqlException
-
readXACommit_
- Throws:
SqlException
-
writeLocalCommit_
- Throws:
SqlException
-
readLocalCommit_
- Throws:
SqlException
-
writeXATransactionStart
- Throws:
SqlException
-
completeLocalCommit
public void completeLocalCommit()- Specified by:
completeLocalCommitin interfaceConnectionCallbackInterface
-
writeLocalRollback_
- Throws:
SqlException
-
readLocalRollback_
- Throws:
SqlException
-
completeLocalRollback
public void completeLocalRollback()- Specified by:
completeLocalRollbackin interfaceConnectionCallbackInterface
-
completeSpecificRollback
Rollback the specific UnitOfWorkListener.- Parameters:
uwl- The UnitOfWorkLitener to be rolled back
-
writeLocalXARollback_
- Throws:
SqlException
-
writeXARollback_
- Throws:
SqlException
-
readLocalXARollback_
- Throws:
SqlException
-
readXARollback_
- Throws:
SqlException
-
writeTransactionStart
- Throws:
SqlException
-
readTransactionStart
- Throws:
SqlException
-
completeTransactionStart
void completeTransactionStart() -
completeAbnormalUnitOfWork
public void completeAbnormalUnitOfWork()- Specified by:
completeAbnormalUnitOfWorkin interfaceConnectionCallbackInterface
-
completeAbnormalUnitOfWork
Rollback the UnitOfWorkListener specifically.- Specified by:
completeAbnormalUnitOfWorkin interfaceConnectionCallbackInterface- Parameters:
uwl- The UnitOfWorkListener to be rolled back.
-
completeChainBreakingDisconnect
public void completeChainBreakingDisconnect()- Specified by:
completeChainBreakingDisconnectin interfaceConnectionCallbackInterface
-
completeSqlca
- Specified by:
completeSqlcain interfaceConnectionCallbackInterface
-
completePiggyBackIsolation
public void completePiggyBackIsolation(int pbIsolation) Description copied from interface:ConnectionCallbackInterfaceCompletes piggy-backing of the new current isolation level by updating the cached copy in am.Connection.- Specified by:
completePiggyBackIsolationin interfaceConnectionCallbackInterface- Parameters:
pbIsolation- new isolation level from the server
-
completeInitialPiggyBackIsolation
public void completeInitialPiggyBackIsolation(int pbIsolation) Sets the default isolation level of the connection upon connection initialization.Note that depending on the server version, the default isolation value may not be piggy-backed on the initialization flow. In that case, the default is assumed / hardcoded to be READ_COMMITTED.
- Parameters:
pbIsolation- isolation level as specified byjava.sql.Connection
-
completePiggyBackSchema
Description copied from interface:ConnectionCallbackInterfaceCompletes piggy-backing of the new current schema by updating the cached copy in am.Connection.- Specified by:
completePiggyBackSchemain interfaceConnectionCallbackInterface- Parameters:
pbSchema- new current schema from the server
-
completeInitialPiggyBackSchema
Sets the current schema upon connection initialization.- Parameters:
pbSchema- the schema name
-
reset
- Throws:
SqlException
-
lightReset
- Throws:
SqlException
-
reset_
- Throws:
SqlException
-
completeReset
protected void completeReset(boolean isDeferredReset, boolean closeStatementsOnClose, NetXAResource xares) throws SqlException
NOTE:The following comments are valid for the changes done as part of implementing statement caching only (see DERBY-3313 and linked issues).We don't reset the isolation level to unknown unconditionally, as this forces us to go to the server all the time. Since the value should now be valid (DERBY-3192), we check if it has been changed from the default.
- Parameters:
closeStatementsOnClose- is used to differentiate between cases where statement pooling is enabled or not. Iftrue, it means statement pooling is disabled and the statements are fully reset, which includes a re-prepare. Iffalse, statement pooling is enabled, and a more lightweight reset procedure is used.- Throws:
SqlException
-
locatorProcedureCall
CallableLocatorProcedures locatorProcedureCall()Get handle to the object that contains prepared statements for calling locator procedures for this connection. The object will be created on the first invocation. An example of how to call a stored procedure via this method:connection.locatorProcedureCall().blobReleaseLocator(locator);- Returns:
- object with prepared statements for calling locator procedures
-
checkForClosedConnection
- Throws:
SqlException
-
isXAConnection
public boolean isXAConnection() -
getXAState
public int getXAState() -
setXAState
public void setXAState(int state) -
accumulateWarning
-
accumulate440WarningForMessageProcFailure
-
accumulate444WarningForMessageProcFailure
-
getServerVersion
public int getServerVersion() -
holdability
final int holdability()Return the holdabilty for the Connection. Matches the embedded driver in the restriction that while in a global (XA) transaction the holdability is CLOSE_CURSORS_AT_COMMIT. Otherwise return the holdability set by the user. -
createClob
Constructs an object that implements theClobinterface. The object returned initially contains no data.- Specified by:
createClobin interfaceConnection- Returns:
- An object that implements the
Clobinterface - Throws:
SQLException- if an object that implements theClobinterface can not be constructed.
-
createBlob
Constructs an object that implements theBlobinterface. The object returned initially contains no data.- Specified by:
createBlobin interfaceConnection- Returns:
- An object that implements the
Blobinterface - Throws:
SQLException- if an object that implements the Blob interface can not be constructed.
-
isAborting
public boolean isAborting()Return true if the connection is aborting -
beginAborting
protected void beginAborting()Begin aborting the connection -
getSchema
Get the name of the current schema.- Specified by:
getSchemain interfaceConnection- Throws:
SQLException
-
setSchema
Set the default schema for the Connection.- Specified by:
setSchemain interfaceConnection- Throws:
SQLException
-
abort
- Specified by:
abortin interfaceConnection- Throws:
SQLException
-
getNetworkTimeout
- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
setNetworkTimeout
- Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException
-