java.lang.Object
org.firebirdsql.gds.ng.TransactionHelper
Class with static helper methods for use with transactions
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckTransactionActive(FbTransaction transaction) Checks if the transaction isTransactionState.ACTIVE.static voidcheckTransactionActive(FbTransaction transaction, int fbErrorCode) Checks if the transaction isTransactionState.ACTIVE.static booleanisTransactionEnding(FbTransaction transaction) Checks if the transaction is ending (meaning its state isTransactionState.COMMITTING,TransactionState.ROLLING_BACKorTransactionState.PREPARING).
-
Method Details
-
checkTransactionActive
Checks if the transaction isTransactionState.ACTIVE.- Parameters:
transaction- transaction to check- Throws:
SQLException- whentransactionisnull, or its state is not active
-
checkTransactionActive
public static void checkTransactionActive(FbTransaction transaction, int fbErrorCode) throws SQLException Checks if the transaction isTransactionState.ACTIVE.- Parameters:
transaction- transaction to checkfbErrorCode- Firebird error code to use for generating the exception message- Throws:
SQLException- whentransactionisnull, or its state is not active
-
isTransactionEnding
Checks if the transaction is ending (meaning its state isTransactionState.COMMITTING,TransactionState.ROLLING_BACKorTransactionState.PREPARING).- Parameters:
transaction- transaction to check- Returns:
trueif the state isCOMMITTING,ROLLING_BACKorPREPARING, otherwisefalse(including whentransactionisnull)- Since:
- 6
-