Package org.firebirdsql.gds.ng
Interface FbTransaction
- 
- All Superinterfaces:
- ExceptionListenable
 - All Known Subinterfaces:
- FbWireTransaction
 - All Known Implementing Classes:
- AbstractFbTransaction,- JnaTransaction,- V10Transaction
 
 public interface FbTransaction extends ExceptionListenable Handle for a transaction.All methods defined in this interface are required to notify all SQLExceptionthrown from the methods defined in this interface.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTransactionListener(TransactionListener listener)Adds aTransactionListenerto the list of strongly referenced listeners.voidaddWeakTransactionListener(TransactionListener listener)Adds aTransactionListenerto the list of weakly referenced listeners.voidcommit()Commit the transactionintgetHandle()TransactionStategetState()longgetTransactionId()Retrieves the transaction id.byte[]getTransactionInfo(byte[] requestItems, int maxBufferLength)Performs a transaction info request.<T> TgetTransactionInfo(byte[] requestItems, int bufferLength, InfoProcessor<T> infoProcessor)Request transaction info.voidprepare(byte[] recoveryInformation)Prepare the transaction for two-phase commit/rollback.voidremoveTransactionListener(TransactionListener listener)Removes theTransactionListenerfrom the list of listeners.voidrollback()Roll back the transaction- 
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenableaddExceptionListener, removeExceptionListener
 
- 
 
- 
- 
- 
Method Detail- 
getStateTransactionState getState() - Returns:
- Current transaction state
 
 - 
getHandleint getHandle() - Returns:
- The Firebird transaction handle identifier
 
 - 
addTransactionListenervoid addTransactionListener(TransactionListener listener) Adds aTransactionListenerto the list of strongly referenced listeners.- Parameters:
- listener- TransactionListener to register
 
 - 
addWeakTransactionListenervoid addWeakTransactionListener(TransactionListener listener) Adds aTransactionListenerto the list of weakly referenced listeners.If the listener is already strongly referenced, this call will be ignored - Parameters:
- listener- TransactionListener to register
 
 - 
removeTransactionListenervoid removeTransactionListener(TransactionListener listener) Removes theTransactionListenerfrom the list of listeners.- Parameters:
- listener- TransactionListener to remove
 
 - 
commitvoid commit() throws java.sql.SQLExceptionCommit the transaction- Throws:
- java.sql.SQLException
 
 - 
rollbackvoid rollback() throws java.sql.SQLExceptionRoll back the transaction- Throws:
- java.sql.SQLException
 
 - 
preparevoid prepare(byte[] recoveryInformation) throws java.sql.SQLExceptionPrepare the transaction for two-phase commit/rollback.- Parameters:
- recoveryInformation- Transaction recovery information (stored in RDB$TRANSACTION_DESCRIPTION of RDB$TRANSACTIONS), or- nullto prepare without recovery information.
- Throws:
- java.sql.SQLException
 
 - 
getTransactionInfo<T> T getTransactionInfo(byte[] requestItems, int bufferLength, InfoProcessor<T> infoProcessor) throws java.sql.SQLExceptionRequest transaction info.- Parameters:
- requestItems- Array of info items to request
- bufferLength- Response buffer length to use
- infoProcessor- Implementation of- InfoProcessorto transform the info response
- Returns:
- Transformed info response of type T
- Throws:
- java.sql.SQLException- For errors retrieving or transforming the response.
 
 - 
getTransactionInfobyte[] getTransactionInfo(byte[] requestItems, int maxBufferLength) throws java.sql.SQLExceptionPerforms 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.
 
 - 
getTransactionIdlong getTransactionId() throws java.sql.SQLExceptionRetrieves 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
 
 
- 
 
-