Package org.firebirdsql.gds.ng.jna
Class JnaTransaction
- java.lang.Object
- 
- org.firebirdsql.gds.ng.AbstractFbTransaction
- 
- org.firebirdsql.gds.ng.jna.JnaTransaction
 
 
- 
- All Implemented Interfaces:
- FbTransaction,- ExceptionListenable
 
 public class JnaTransaction extends AbstractFbTransaction Implementation ofFbTransactionfor native client access.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Field Summary- 
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbTransactionexceptionListenerDispatcher, transactionListenerDispatcher
 
- 
 - 
Constructor SummaryConstructors Constructor Description JnaTransaction(JnaDatabase database, com.sun.jna.ptr.IntByReference transactionHandle, TransactionState initialState)Initializes AbstractFbTransaction.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()Commit the transactionJnaDatabasegetDatabase()intgetHandle()com.sun.jna.ptr.IntByReferencegetJnaHandle()byte[]getTransactionInfo(byte[] requestItems, int maxBufferLength)Performs a transaction info request.voidprepare(byte[] recoveryInformation)Prepare the transaction for two-phase commit/rollback.voidrollback()Roll back the transaction- 
Methods inherited from class org.firebirdsql.gds.ng.AbstractFbTransactionaddExceptionListener, addTransactionListener, addWeakTransactionListener, finalize, getState, getSynchronizationObject, getTransactionId, getTransactionInfo, removeExceptionListener, removeTransactionListener, switchState
 
- 
 
- 
- 
- 
Constructor Detail- 
JnaTransactionpublic JnaTransaction(JnaDatabase database, com.sun.jna.ptr.IntByReference transactionHandle, TransactionState initialState) Initializes AbstractFbTransaction.- Parameters:
- database- FbDatabase that created this handle.
- transactionHandle- Transaction handle
- initialState- Initial transaction state (allowed values are- TransactionState.ACTIVEand- TransactionState.PREPARED.
 
 
- 
 - 
Method Detail- 
getDatabasepublic JnaDatabase getDatabase() - Overrides:
- getDatabasein class- AbstractFbTransaction
 
 - 
getHandlepublic int getHandle() - Returns:
- The Firebird transaction handle identifier
 
 - 
getJnaHandlepublic com.sun.jna.ptr.IntByReference getJnaHandle() 
 - 
commitpublic void commit() throws java.sql.SQLExceptionDescription copied from interface:FbTransactionCommit the transaction- Throws:
- java.sql.SQLException
 
 - 
rollbackpublic void rollback() throws java.sql.SQLExceptionDescription copied from interface:FbTransactionRoll back the transaction- Throws:
- java.sql.SQLException
 
 - 
preparepublic void prepare(byte[] recoveryInformation) throws java.sql.SQLExceptionDescription copied from interface:FbTransactionPrepare 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
 
 - 
getTransactionInfopublic byte[] getTransactionInfo(byte[] requestItems, int maxBufferLength) throws java.sql.SQLExceptionDescription copied from interface:FbTransactionPerforms 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.
 
 
- 
 
-