Interface FbTransaction

    • Method Detail

      • getHandle

        int getHandle()
        Returns:
        The Firebird transaction handle identifier
      • addTransactionListener

        void addTransactionListener​(TransactionListener listener)
        Adds a TransactionListener to the list of strongly referenced listeners.
        Parameters:
        listener - TransactionListener to register
      • addWeakTransactionListener

        void addWeakTransactionListener​(TransactionListener listener)
        Adds a TransactionListener to the list of weakly referenced listeners.

        If the listener is already strongly referenced, this call will be ignored

        Parameters:
        listener - TransactionListener to register
      • removeTransactionListener

        void removeTransactionListener​(TransactionListener listener)
        Removes the TransactionListener from the list of listeners.
        Parameters:
        listener - TransactionListener to remove
      • commit

        void commit()
             throws java.sql.SQLException
        Commit the transaction
        Throws:
        java.sql.SQLException
      • rollback

        void rollback()
               throws java.sql.SQLException
        Roll back the transaction
        Throws:
        java.sql.SQLException
      • prepare

        void prepare​(byte[] recoveryInformation)
              throws java.sql.SQLException
        Prepare the transaction for two-phase commit/rollback.
        Parameters:
        recoveryInformation - Transaction recovery information (stored in RDB$TRANSACTION_DESCRIPTION of RDB$TRANSACTIONS), or null to prepare without recovery information.
        Throws:
        java.sql.SQLException
      • getTransactionInfo

        <T> T getTransactionInfo​(byte[] requestItems,
                                 int bufferLength,
                                 InfoProcessor<T> infoProcessor)
                          throws java.sql.SQLException
        Request transaction info.
        Parameters:
        requestItems - Array of info items to request
        bufferLength - Response buffer length to use
        infoProcessor - Implementation of InfoProcessor to transform the info response
        Returns:
        Transformed info response of type T
        Throws:
        java.sql.SQLException - For errors retrieving or transforming the response.
      • getTransactionInfo

        byte[] getTransactionInfo​(byte[] requestItems,
                                  int maxBufferLength)
                           throws java.sql.SQLException
        Performs a transaction info request.
        Parameters:
        requestItems - Information items to request
        maxBufferLength - Maximum response buffer length to use
        Returns:
        The response buffer (note: length is the actual length of the response, not maxBufferLength
        Throws:
        java.sql.SQLException - For errors retrieving the information.
      • getTransactionId

        long getTransactionId()
                       throws java.sql.SQLException
        Retrieves the transaction id.

        The transaction id is the database transaction id, not to be confused with the attachment level transaction handle provided by getHandle().

        Returns:
        Database transaction id.
        Throws:
        java.sql.SQLException