Class V10Transaction

    • Constructor Detail

      • V10Transaction

        public V10Transaction​(FbWireDatabase database,
                              int transactionHandle,
                              TransactionState initialState)
        Creates a new instance of V10Transaction for the specified database.

        This can either be used for an active handle (with initialState TransactionState.ACTIVE), or a reconnected (prepared) handle (with initialState TransactionState.PREPARED).

        Parameters:
        database - FbWireDatabase implementation
        transactionHandle - Transaction handle
        initialState - The initial state of the transaction (only ACTIVE or PREPARED allowed).
    • Method Detail

      • getXdrOut

        protected final XdrOutputStream getXdrOut()
                                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getHandle

        public int getHandle()
        Specified by:
        getHandle in interface FbTransaction
        Returns:
        The Firebird transaction handle identifier
      • commit

        public void commit()
                    throws java.sql.SQLException
        Description copied from interface: FbTransaction
        Commit the transaction
        Specified by:
        commit in interface FbTransaction
        Throws:
        java.sql.SQLException
      • rollback

        public void rollback()
                      throws java.sql.SQLException
        Description copied from interface: FbTransaction
        Roll back the transaction
        Specified by:
        rollback in interface FbTransaction
        Throws:
        java.sql.SQLException
      • prepare

        public void prepare​(byte[] recoveryInformation)
                     throws java.sql.SQLException
        Description copied from interface: FbTransaction
        Prepare the transaction for two-phase commit/rollback.
        Specified by:
        prepare in interface FbTransaction
        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

        public byte[] getTransactionInfo​(byte[] requestItems,
                                         int maxBufferLength)
                                  throws java.sql.SQLException
        Description copied from interface: FbTransaction
        Performs a transaction info request.
        Specified by:
        getTransactionInfo in interface FbTransaction
        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.