Package org.firebirdsql.gds.ng

## Class TransactionHelper

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

-     public class TransactionHelper
      extends java.lang.Object

  Class with static helper methods for use with transactions
  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `NO_TRANSACTION_ACTIVE` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `checkTransactionActive​(FbTransaction transaction)` | Checks if this statement has a transaction and that the transaction is `TransactionState.ACTIVE`.
    `static void` | `checkTransactionActive​(FbTransaction transaction, int fbErrorCode)` | Checks if this statement has a transaction and that the transaction is `TransactionState.ACTIVE`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NO_TRANSACTION_ACTIVE

          public static final java.lang.String NO_TRANSACTION_ACTIVE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### checkTransactionActive

          public static void checkTransactionActive​(FbTransaction transaction)
                                             throws java.sql.SQLException

      Checks if this statement has a transaction and that the transaction is `TransactionState.ACTIVE`.
      Parameters:
        `transaction` - The transaction to check
      Throws:
        `java.sql.SQLException` - When this statement does not have a transaction, or if that transaction is not active.

    - #### checkTransactionActive

          public static void checkTransactionActive​(FbTransaction transaction,
                                                    int fbErrorCode)
                                             throws java.sql.SQLException

      Checks if this statement has a transaction and that the transaction is `TransactionState.ACTIVE`.
      Parameters:
        `transaction` - The transaction to check
        `fbErrorCode` - Firebird error code to use for generating the exception message
      Throws:
        `java.sql.SQLException` - When this statement does not have a transaction, or if that transaction is not active.