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, waitcommit, getHandle, getTransactionInfo, prepare, rollbackprotected 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 FbTransactionprotected 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)
FbTransactionTransactionListener to the list of strongly referenced listeners.addTransactionListener in interface FbTransactionlistener - TransactionListener to registerpublic final void addWeakTransactionListener(TransactionListener listener)
FbTransactionTransactionListener to the list of weakly referenced listeners.
If the listener is already strongly referenced, this call will be ignored
addWeakTransactionListener in interface FbTransactionlistener - TransactionListener to registerpublic final void removeTransactionListener(TransactionListener listener)
FbTransactionTransactionListener from the list of listeners.removeTransactionListener in interface FbTransactionlistener - TransactionListener to removepublic final void addExceptionListener(ExceptionListener listener)
ExceptionListenable
Implementations use WeakReference.
addExceptionListener in interface ExceptionListenablelistener - Listener to registerpublic final void removeExceptionListener(ExceptionListener listener)
ExceptionListenableremoveExceptionListener in interface ExceptionListenablelistener - Listener to removepublic <T> T getTransactionInfo(byte[] requestItems,
int bufferLength,
InfoProcessor<T> infoProcessor)
throws java.sql.SQLException
FbTransactiongetTransactionInfo in interface FbTransactionrequestItems - 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 FbTransactionjava.sql.SQLExceptionprotected final java.lang.Object getSynchronizationObject()
null.protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprotected FbDatabase getDatabase()
Copyright © 2001-2020 Jaybird (Firebird JDBC/JCA) team. All rights reserved.