java.lang.Object
org.firebirdsql.gds.ng.AbstractFbTransaction
org.firebirdsql.gds.ng.wire.version10.V10Transaction
- All Implemented Interfaces:
FbTransaction,ExceptionListenable,FbWireTransaction
FbTransaction implementation for the version 10 wire protocol.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Field Summary
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbTransaction
exceptionListenerDispatcher, transactionListenerDispatcher -
Constructor Summary
ConstructorsConstructorDescriptionV10Transaction(FbWireDatabase database, int transactionHandle, TransactionState initialState) Creates a new instance of V10Transaction for the specified database. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()Commit the transactionprotected FbWireDatabaseintbyte[]getTransactionInfo(byte[] requestItems, int maxBufferLength) Performs a transaction info request.protected final XdrOutputStreamvoidprepare(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, getState, getTransactionId, getTransactionInfo, logUnexpectedState, removeExceptionListener, removeTransactionListener, switchState, withLockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListenerMethods inherited from interface org.firebirdsql.gds.ng.FbTransaction
addTransactionListener, addWeakTransactionListener, getState, getTransactionId, getTransactionInfo, removeTransactionListener
-
Constructor Details
-
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
initialStateTransactionState.ACTIVE), or a reconnected (prepared) handle (withinitialStateTransactionState.PREPARED).- Parameters:
database- FbWireDatabase implementationtransactionHandle- Transaction handleinitialState- The initial state of the transaction (onlyACTIVEorPREPAREDallowed).
-
-
Method Details
-
getXdrOut
- Throws:
SQLException
-
getDatabase
- Overrides:
getDatabasein classAbstractFbTransaction
-
getHandle
public int getHandle()- Specified by:
getHandlein interfaceFbTransaction- Returns:
- The Firebird transaction handle identifier
-
commit
Description copied from interface:FbTransactionCommit the transaction- Specified by:
commitin interfaceFbTransaction- Throws:
SQLException
-
rollback
Description copied from interface:FbTransactionRoll back the transaction- Specified by:
rollbackin interfaceFbTransaction- Throws:
SQLException
-
prepare
Description copied from interface:FbTransactionPrepare the transaction for two-phase commit/rollback.- Specified by:
preparein interfaceFbTransaction- 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.- Specified by:
getTransactionInfoin interfaceFbTransaction- 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.
-