Transaction
Xact
public abstract class RawTransaction extends DerbyObservable implements Transaction
The transaction will notify any Observer's just before the transaction is committed, aborted or a rollback to savepoint occurs. The argument passed to the update() method of the Observer's will be one of
Observer
Modifier and Type | Field | Description |
---|---|---|
static java.lang.Integer |
ABORT |
|
static java.lang.Integer |
COMMIT |
|
static java.lang.Integer |
LOCK_ESCALATE |
|
protected StandardException |
observerException |
|
static java.lang.Integer |
SAVEPOINT_ROLLBACK |
KEEP_LOCKS, RELEASE_LOCKS, XA_OK, XA_RDONLY
Constructor | Description |
---|---|
RawTransaction() |
Modifier and Type | Method | Description |
---|---|---|
abstract void |
addUpdateTransaction(int transactionStatus) |
Add this raw transaction on to the list of update transaction
|
abstract boolean |
blockBackup(boolean wait) |
Make the transaction block the online backup.
|
void |
checkLogicalOperationOk() |
Check to see if a logical operation is allowed by this transaction,
throws a TransactionExceotion if it isn't.
|
abstract void |
checkpointInRollForwardRecovery(LogInstant cinstant,
long redoLWM,
long undoLWM) |
Redo a checkpoint during rollforward recovery.
|
abstract DataFactory |
getDataFactory() |
Get the data factory to be used during this transaction.
|
abstract LogInstant |
getFirstLogInstant() |
Get the log instant for the first log record written by this
transaction.
|
abstract GlobalTransactionId |
getGlobalId() |
Get the shortId of this transaction.
|
abstract TransactionId |
getId() |
Get the shortId of this transaction.
|
abstract LogInstant |
getLastLogInstant() |
Get the log instant for the last log record written by this transaction.
|
abstract LockFactory |
getLockFactory() |
Get the lock factory to be used during this transaction.
|
abstract DynamicByteArrayOutputStream |
getLogBuffer() |
Get the log buffer to be used during this transaction.
|
abstract LogFactory |
getLogFactory() |
Get the log factory to be used during this transaction.
|
abstract boolean |
handlesPostTerminationWork() |
Can this transaction handles post termination work
|
abstract boolean |
inAbort() |
Is the transaction in the middle of an abort.
|
abstract boolean |
inRollForwardRecovery() |
Retunrs true if the transaction is part of rollforward recovery
|
abstract boolean |
isBlockingBackup() |
Check if the transaction is blocking the backup ?
|
abstract void |
logAndUndo(Compensation compensation,
LogInstant undoInstant,
LimitObjectInput in) |
Log a compensation operation and then action it in the context of this
transaction.
|
void |
notifyObservers(java.lang.Object arg) |
Allow my users to notigy my observers.
|
abstract RawContainerHandle |
openDroppedContainer(ContainerKey containerId,
LockingPolicy locking) |
Open a container that may be dropped - use only by logging and recovery.
|
abstract void |
prepareTransaction() |
Change the state of transaction in table to prepare.
|
boolean |
recoveryRollbackFirst() |
Return true if this transaction should be rolled back first
in recovery.
|
abstract void |
recoveryTransaction() |
Make this transaction aware that it is being used by recovery
|
abstract void |
reCreateContainerForRedoRecovery(long segmentId,
long containerId,
ByteArray containerInfo) |
Recreate a container during redo recovery.
|
abstract void |
removeUpdateTransaction() |
Remove this raw transaction from the list of update transaction
|
abstract void |
reprepare() |
During recovery re-prepare a transaction.
|
abstract void |
setFirstLogInstant(LogInstant instant) |
Set the log instant for the first log record written by this
transaction.
|
abstract void |
setLastLogInstant(LogInstant instant) |
Set the log instant for the last log record written by this transaction.
|
void |
setObserverException(StandardException se) |
Allow an Observer to indicate an exception to the transaction that
is raised in its update() method.
|
abstract void |
setTransactionId(Loggable beginXact,
TransactionId shortId) |
Set the transactionId (Global and internal) of this transaction using a
log record that contains the Global id
|
abstract RawTransaction |
startNestedTopTransaction() |
Start a nested top transaction.
|
protected abstract int |
statusForBeginXactLog() |
Status that needs to go into the begin transaction log record, if there
is one, to help with recovery
|
protected abstract int |
statusForEndXactLog() |
Status that needs to go into the end transaction log record, if there
is one, to help with recovery
|
addObserver, countObservers, deleteObserver, notifyObservers, setChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abort, addAndLoadStreamContainer, addContainer, addPostAbortWork, addPostCommitWork, addPostTerminationWork, anyoneBlocked, close, commit, commitNoSync, createXATransactionFromLocalTransaction, destroy, dropContainer, dropStreamContainer, getActiveStateTxIdString, getCompatibilitySpace, getContextManager, getDataValueFactory, getDefaultLockingPolicy, getFileHandler, isIdle, isPristine, logAndDo, newLockingPolicy, openContainer, openContainer, openStreamContainer, releaseSavePoint, rollbackToSavePoint, setDefaultLockingPolicy, setNoLockWait, setSavePoint, setup, xa_commit, xa_prepare, xa_rollback
public static final java.lang.Integer COMMIT
public static final java.lang.Integer ABORT
public static final java.lang.Integer SAVEPOINT_ROLLBACK
public static final java.lang.Integer LOCK_ESCALATE
protected StandardException observerException
public abstract LockFactory getLockFactory()
public abstract DataFactory getDataFactory()
public abstract LogFactory getLogFactory()
public abstract DynamicByteArrayOutputStream getLogBuffer()
public abstract void logAndUndo(Compensation compensation, LogInstant undoInstant, LimitObjectInput in) throws StandardException
compensation
- the Compensation OperationundoInstant
- the LogInstant of the Loggable Operation this
compensation operation is going to roll backin
- optional data for the rollback operationStandardException
- Standard Derby exception policyCompensation
public abstract void setTransactionId(Loggable beginXact, TransactionId shortId)
public abstract TransactionId getId()
public abstract GlobalTransactionId getGlobalId()
getGlobalId
in interface Transaction
public abstract void addUpdateTransaction(int transactionStatus)
public abstract void removeUpdateTransaction()
public abstract void prepareTransaction()
public abstract void setFirstLogInstant(LogInstant instant)
public abstract LogInstant getFirstLogInstant()
public abstract void setLastLogInstant(LogInstant instant)
public abstract LogInstant getLastLogInstant()
public void checkLogicalOperationOk() throws StandardException
StandardException
- Standard Derby error policy,public boolean recoveryRollbackFirst()
public abstract void reprepare() throws StandardException
After redo() and undo(), this routine is called on all outstanding in-doubt (prepared) transactions. This routine re-acquires all logical write locks for operations in the xact, and then modifies the transaction table entry to make the transaction look as if it had just been prepared following startup after recovery.
StandardException
- Standard exception policy.public void setObserverException(StandardException se)
public abstract RawTransaction startNestedTopTransaction() throws StandardException
StandardException
- Standard Derby error policypublic abstract RawContainerHandle openDroppedContainer(ContainerKey containerId, LockingPolicy locking) throws StandardException
StandardException
- Standard Derby exception policypublic abstract void reCreateContainerForRedoRecovery(long segmentId, long containerId, ByteArray containerInfo) throws StandardException
StandardException
- Standard Derby exception policyprotected abstract int statusForBeginXactLog()
protected abstract int statusForEndXactLog()
public abstract boolean inAbort()
public abstract boolean handlesPostTerminationWork()
public abstract void recoveryTransaction()
public void notifyObservers(java.lang.Object arg)
notifyObservers
in class DerbyObservable
arg
- Extra information to be passed to the observer's callback method.public abstract boolean inRollForwardRecovery()
public abstract void checkpointInRollForwardRecovery(LogInstant cinstant, long redoLWM, long undoLWM) throws StandardException
cinstant
- The LogInstant of the checkpointredoLWM
- Redo Low Water Mark in the check point recordundoLWM
- Undo Low Water Mark in the checkpointStandardException
- Exception encountered during checkpointpublic abstract boolean blockBackup(boolean wait) throws StandardException
wait
- if true, waits until the transaction
can block the backup.StandardException
- if interrupted while waiting
for the backup in progress to complete.public abstract boolean isBlockingBackup()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.