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 void
checkTransactionActive
(FbTransaction transaction) Checks if the transaction isTransactionState.ACTIVE
.static void
checkTransactionActive
(FbTransaction transaction, int fbErrorCode) Checks if the transaction isTransactionState.ACTIVE
.static boolean
isTransactionEnding
(FbTransaction transaction) Checks if the transaction is ending (meaning its state isTransactionState.COMMITTING
,TransactionState.ROLLING_BACK
orTransactionState.PREPARING
).
-
Method Details
-
checkTransactionActive
Checks if the transaction isTransactionState.ACTIVE
.- Parameters:
transaction
- transaction to check- Throws:
SQLException
- whentransaction
isnull
, 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
- whentransaction
isnull
, or its state is not active
-
isTransactionEnding
Checks if the transaction is ending (meaning its state isTransactionState.COMMITTING
,TransactionState.ROLLING_BACK
orTransactionState.PREPARING
).- Parameters:
transaction
- transaction to check- Returns:
true
if the state isCOMMITTING
,ROLLING_BACK
orPREPARING
, otherwisefalse
(including whentransaction
isnull
)- Since:
- 6
-