Class TransactionHelper

java.lang.Object
org.firebirdsql.gds.ng.TransactionHelper

public final class TransactionHelper extends Object
Class with static helper methods for use with transactions
Since:
3.0
Author:
Mark Rotteveel
  • Method Details

    • checkTransactionActive

      public static void checkTransactionActive(FbTransaction transaction) throws SQLException
      Checks if the transaction is TransactionState.ACTIVE.
      Parameters:
      transaction - transaction to check
      Throws:
      SQLException - when transaction is null, or its state is not active
    • checkTransactionActive

      public static void checkTransactionActive(FbTransaction transaction, int fbErrorCode) throws SQLException
      Checks if the transaction is TransactionState.ACTIVE.
      Parameters:
      transaction - transaction to check
      fbErrorCode - Firebird error code to use for generating the exception message
      Throws:
      SQLException - when transaction is null, or its state is not active
    • isTransactionEnding

      public static boolean isTransactionEnding(FbTransaction transaction)
      Checks if the transaction is ending (meaning its state is TransactionState.COMMITTING, TransactionState.ROLLING_BACK or TransactionState.PREPARING).
      Parameters:
      transaction - transaction to check
      Returns:
      true if the state is COMMITTING, ROLLING_BACK or PREPARING, otherwise false (including when transaction is null)
      Since:
      6