Interface BrokeredConnectionControl
- All Known Implementing Classes:
EmbedPooledConnection, EmbedXAConnection
public interface BrokeredConnectionControl
Provides control over a BrokeredConnection
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAutoCommit(boolean autoCommit) Allow control over setting auto commit mode.voidCheck if the brokered connection can be closed.voidAllow control over calling commit.intcheckHoldCursors(int holdability, boolean downgrade) Can cursors be held across commits.voidAllow control over calling rollback.voidAllow control over creating a Savepoint (JDBC 3.0)booleanClose called on BrokeredConnection.Return the real JDBC connection for the brokered connection.booleanIs this a global transactionbooleanReturns true if isolation level has been set using JDBC/SQL.voidnotifyException(SQLException sqle) Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods.voidonStatementClose(PreparedStatement statement) Close called on the associated PreparedStatement objectvoidonStatementErrorOccurred(PreparedStatement statement, SQLException sqle) Error occurred on associated PreparedStatement objectvoidReset the isolation level flag used to keep state in BrokeredConnection.wrapStatement(CallableStatement realStatement, String sql) Optionally wrap a CallableStatement with an CallableStatement.wrapStatement(PreparedStatement realStatement, String sql, Object generateKeys) Optionally wrap a PreparedStatement with another PreparedStatement.wrapStatement(Statement realStatement) Optionally wrap a Statement with another Statement.
-
Method Details
-
getRealConnection
Return the real JDBC connection for the brokered connection.- Throws:
SQLException
-
notifyException
Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods. -
checkAutoCommit
Allow control over setting auto commit mode.- Throws:
SQLException
-
checkSavepoint
Allow control over creating a Savepoint (JDBC 3.0)- Throws:
SQLException
-
checkRollback
-
checkCommit
-
checkClose
Check if the brokered connection can be closed.- Throws:
SQLException- if it is not allowed to call close on the brokered connection
-
checkHoldCursors
Can cursors be held across commits.- Parameters:
downgrade- true to downgrade the holdability, false to throw an exception.- Throws:
SQLException
-
isIsolationLevelSetUsingSQLorJDBC
Returns true if isolation level has been set using JDBC/SQL.- Throws:
SQLException
-
resetIsolationLevelFlag
Reset the isolation level flag used to keep state in BrokeredConnection. It will get set to true when isolation level is set using JDBC/SQL. It will get reset to false at the start and the end of a global transaction.- Throws:
SQLException
-
isInGlobalTransaction
boolean isInGlobalTransaction()Is this a global transaction- Returns:
- true if this is a global XA transaction
-
closingConnection
Close called on BrokeredConnection. If this call returns true then getRealConnection().close() will be called.- Throws:
SQLException
-
wrapStatement
Optionally wrap a Statement with another Statement.- Throws:
SQLException
-
wrapStatement
PreparedStatement wrapStatement(PreparedStatement realStatement, String sql, Object generateKeys) throws SQLException Optionally wrap a PreparedStatement with another PreparedStatement.- Throws:
SQLException
-
wrapStatement
Optionally wrap a CallableStatement with an CallableStatement.- Throws:
SQLException
-
onStatementClose
Close called on the associated PreparedStatement object- Parameters:
statement- PreparedStatement object on which the close event occurred
-
onStatementErrorOccurred
Error occurred on associated PreparedStatement object- Parameters:
statement- PreparedStatement object on which the error occuredsqle- The SQLExeption that caused the error
-