public abstract class AbstractFbTransaction extends java.lang.Object implements FbTransaction
Modifier and Type | Field and Description |
---|---|
protected ExceptionListenerDispatcher |
exceptionListenerDispatcher |
protected TransactionListenerDispatcher |
transactionListenerDispatcher |
Modifier | Constructor and Description |
---|---|
protected |
AbstractFbTransaction(TransactionState initialState,
FbDatabase database)
Initializes AbstractFbTransaction.
|
Modifier and Type | Method and Description |
---|---|
void |
addExceptionListener(ExceptionListener listener)
Adds an exception listener to this object.
|
void |
addTransactionListener(TransactionListener listener)
Adds a
TransactionListener to the list of strongly referenced listeners. |
void |
addWeakTransactionListener(TransactionListener listener)
Adds a
TransactionListener to the list of weakly referenced listeners. |
protected void |
finalize() |
protected FbDatabase |
getDatabase() |
TransactionState |
getState() |
protected java.lang.Object |
getSynchronizationObject()
Get synchronization object.
|
long |
getTransactionId()
Retrieves the transaction id.
|
<T> T |
getTransactionInfo(byte[] requestItems,
int bufferLength,
InfoProcessor<T> infoProcessor)
Request transaction info.
|
void |
removeExceptionListener(ExceptionListener listener)
Removes an exception listener to this object.
|
void |
removeTransactionListener(TransactionListener listener)
Removes the
TransactionListener from the list of listeners. |
protected void |
switchState(TransactionState newState)
Switches current state to the supplied newState.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
commit, getHandle, getTransactionInfo, prepare, rollback
protected final ExceptionListenerDispatcher exceptionListenerDispatcher
protected final TransactionListenerDispatcher transactionListenerDispatcher
protected AbstractFbTransaction(TransactionState initialState, FbDatabase database)
initialState
- Initial transaction state (allowed values are TransactionState.ACTIVE
and TransactionState.PREPARED
.database
- FbDatabase that created this handle.public final TransactionState getState()
getState
in interface FbTransaction
protected final void switchState(TransactionState newState) throws java.sql.SQLException
newState
- New state to switch tojava.sql.SQLException
- If the requested state transition is not allowed or if the
current state is also changed in a concurrent thread.public final void addTransactionListener(TransactionListener listener)
FbTransaction
TransactionListener
to the list of strongly referenced listeners.addTransactionListener
in interface FbTransaction
listener
- TransactionListener to registerpublic final void addWeakTransactionListener(TransactionListener listener)
FbTransaction
TransactionListener
to the list of weakly referenced listeners.
If the listener is already strongly referenced, this call will be ignored
addWeakTransactionListener
in interface FbTransaction
listener
- TransactionListener to registerpublic final void removeTransactionListener(TransactionListener listener)
FbTransaction
TransactionListener
from the list of listeners.removeTransactionListener
in interface FbTransaction
listener
- TransactionListener to removepublic final void addExceptionListener(ExceptionListener listener)
ExceptionListenable
Implementations use WeakReference
.
addExceptionListener
in interface ExceptionListenable
listener
- Listener to registerpublic final void removeExceptionListener(ExceptionListener listener)
ExceptionListenable
removeExceptionListener
in interface ExceptionListenable
listener
- Listener to removepublic <T> T getTransactionInfo(byte[] requestItems, int bufferLength, InfoProcessor<T> infoProcessor) throws java.sql.SQLException
FbTransaction
getTransactionInfo
in interface FbTransaction
requestItems
- Array of info items to requestbufferLength
- Response buffer length to useinfoProcessor
- Implementation of InfoProcessor
to transform
the info responsejava.sql.SQLException
- For errors retrieving or transforming the response.public long getTransactionId() throws java.sql.SQLException
FbTransaction
The transaction id is the database transaction id, not to be confused with the attachment level transaction
handle provided by FbTransaction.getHandle()
.
getTransactionId
in interface FbTransaction
java.sql.SQLException
protected final java.lang.Object getSynchronizationObject()
null
.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected FbDatabase getDatabase()
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.