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
Implementation of
FbTransaction for native client access.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Field Summary
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbTransaction
exceptionListenerDispatcher, transactionListenerDispatcher -
Constructor Summary
ConstructorsConstructorDescriptionJnaTransaction(JnaDatabase database, com.sun.jna.ptr.IntByReference transactionHandle, TransactionState initialState) Initializes AbstractFbTransaction. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()Commit the transactionintcom.sun.jna.ptr.IntByReferencebyte[]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 transactionMethods inherited from class org.firebirdsql.gds.ng.AbstractFbTransaction
addExceptionListener, addTransactionListener, addWeakTransactionListener, finalize, getState, getSynchronizationObject, getTransactionId, getTransactionInfo, removeExceptionListener, removeTransactionListener, switchState
-
Constructor Details
-
JnaTransaction
public JnaTransaction(JnaDatabase database, com.sun.jna.ptr.IntByReference transactionHandle, TransactionState initialState) Initializes AbstractFbTransaction.- Parameters:
database- FbDatabase that created this handle.transactionHandle- Transaction handleinitialState- Initial transaction state (allowed values areTransactionState.ACTIVEandTransactionState.PREPARED.
-
-
Method Details
-
getDatabase
- Overrides:
getDatabasein classAbstractFbTransaction
-
getHandle
public int getHandle()- Returns:
- The Firebird transaction handle identifier
-
getJnaHandle
public com.sun.jna.ptr.IntByReference getJnaHandle() -
commit
Description copied from interface:FbTransactionCommit the transaction- Throws:
SQLException
-
rollback
Description copied from interface:FbTransactionRoll back the transaction- Throws:
SQLException
-
prepare
Description copied from interface:FbTransactionPrepare the transaction for two-phase commit/rollback.- Parameters:
recoveryInformation- Transaction recovery information (stored in RDB$TRANSACTION_DESCRIPTION of RDB$TRANSACTIONS), ornullto prepare without recovery information.- Throws:
SQLException
-
getTransactionInfo
Description copied from interface:FbTransactionPerforms a transaction info request.- Parameters:
requestItems- Information items to requestmaxBufferLength- Maximum response buffer length to use- Returns:
- The response buffer (note: length is the actual length of the
response, not
maxBufferLength - Throws:
SQLException- For errors retrieving the information.
-