|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> store >> raw >> [ xact overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.iapi.store.raw.xact
Class RawTransaction

java.lang.Objectjava.util.Observable
org.apache.derby.iapi.store.raw.xact.RawTransaction
- All Implemented Interfaces:
- org.apache.derby.iapi.store.raw.Transaction
- public abstract class RawTransaction
- extends java.util.Observable
- implements org.apache.derby.iapi.store.raw.Transaction
- extends java.util.Observable
RawTransaction is the form of Transaction used within the raw store. This allows the break down of RawStore functionality into (at least) three modules (Transactions, Data, Log) without exposing internal information on the external interface.
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
- RawTransaction.COMMIT - transaction is committing
- RawTransaction.ABORT - transaction is aborting
- RawTransaction.SAVEPOINTROLLBACK - transaction is being rolled back to a savepoint
| Field Summary | |
static java.lang.Integer |
ABORT
|
static java.lang.Integer |
COMMIT
|
static java.lang.Integer |
LOCK_ESCALATE
|
protected org.apache.derby.iapi.error.StandardException |
observerException
|
static java.lang.Integer |
SAVEPOINT_ROLLBACK
|
| Fields inherited from class java.util.Observable |
|
| Fields inherited from interface org.apache.derby.iapi.store.raw.Transaction |
KEEP_LOCKS, RELEASE_LOCKS, XA_OK, XA_RDONLY |
| Constructor Summary | |
RawTransaction()
|
|
| Method Summary | |
abstract void |
addUpdateTransaction(int transactionStatus)
Add this raw transaction on to the list of update transaction |
void |
checkLogicalOperationOk()
Check to see if a logical operation is allowed by this transaction, throws a TransactionExceotion if it isn't. |
abstract void |
checkpointInRollForwardRecovery(org.apache.derby.iapi.store.raw.log.LogInstant cinstant,
long redoLWM)
redo a checkpoint during rollforward recovery |
abstract long[] |
getCacheStats(java.lang.String cacheName)
Get cache statistics for the specified cache |
abstract org.apache.derby.iapi.store.raw.data.DataFactory |
getDataFactory()
Get the data factory to be used during this transaction. |
abstract org.apache.derby.iapi.store.raw.log.LogInstant |
getFirstLogInstant()
Get the log instant for the first log record written by this transaction. |
abstract org.apache.derby.iapi.store.raw.GlobalTransactionId |
getGlobalId()
Get the shortId of this transaction. |
abstract TransactionId |
getId()
Get the shortId of this transaction. |
abstract org.apache.derby.iapi.store.raw.log.LogInstant |
getLastLogInstant()
Get the log instant for the last log record written by this transaction. |
abstract org.apache.derby.iapi.services.locks.LockFactory |
getLockFactory()
Get the lock factory to be used during this transaction. |
abstract org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream |
getLogBuffer()
Get the log buffer 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 void |
logAndUndo(org.apache.derby.iapi.store.raw.Compensation compensation,
org.apache.derby.iapi.store.raw.log.LogInstant undoInstant,
org.apache.derby.iapi.services.io.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 org.apache.derby.iapi.store.raw.data.RawContainerHandle |
openDroppedContainer(org.apache.derby.iapi.store.raw.ContainerKey containerId,
org.apache.derby.iapi.store.raw.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 |
reCreateContainerForLoadTran(long segmentId,
long containerId,
org.apache.derby.iapi.util.ByteArray containerInfo)
Recreate a container during load tran - use only by media 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 |
resetCacheStats(java.lang.String cacheName)
Reset the cache statistics for the specified cache |
abstract void |
setFirstLogInstant(org.apache.derby.iapi.store.raw.log.LogInstant instant)
Set the log instant for the first log record written by this transaction. |
abstract void |
setLastLogInstant(org.apache.derby.iapi.store.raw.log.LogInstant instant)
Set the log instant for the last log record written by this transaction. |
void |
setObserverException(org.apache.derby.iapi.error.StandardException se)
Allow an Observer to indicate an exception to the transaction that is raised in its update() method. |
abstract void |
setTransactionId(org.apache.derby.iapi.store.raw.GlobalTransactionId id,
TransactionId shortId)
Set the transaction Ids (Global and internal) of this transaction |
abstract void |
setTransactionId(org.apache.derby.iapi.store.raw.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 |
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.store.raw.Transaction |
abort, addAndLoadStreamContainer, addContainer, addPostCommitWork, addPostTerminationWork, anyoneBlocked, close, commit, commitNoSync, createXATransactionFromLocalTransaction, destroy, dropContainer, dropStreamContainer, getActiveStateTxIdString, getCompatibilitySpace, getContextManager, getDefaultLockingPolicy, getFileHandler, isIdle, isPristine, logAndDo, newLockingPolicy, openContainer, openContainer, openStreamContainer, releaseSavePoint, rollbackToSavePoint, setDefaultLockingPolicy, setSavePoint, setup, xa_commit, xa_prepare, xa_rollback |
| Field Detail |
COMMIT
public static final java.lang.Integer COMMIT
ABORT
public static final java.lang.Integer ABORT
SAVEPOINT_ROLLBACK
public static final java.lang.Integer SAVEPOINT_ROLLBACK
LOCK_ESCALATE
public static final java.lang.Integer LOCK_ESCALATE
observerException
protected org.apache.derby.iapi.error.StandardException observerException
| Constructor Detail |
RawTransaction
public RawTransaction()
| Method Detail |
getLockFactory
public abstract org.apache.derby.iapi.services.locks.LockFactory getLockFactory()
- Get the lock factory to be used during this transaction.
getDataFactory
public abstract org.apache.derby.iapi.store.raw.data.DataFactory getDataFactory()
- Get the data factory to be used during this transaction.
getCacheStats
public abstract long[] getCacheStats(java.lang.String cacheName)
- Get cache statistics for the specified cache
- Specified by:
getCacheStatsin interfaceorg.apache.derby.iapi.store.raw.Transaction
resetCacheStats
public abstract void resetCacheStats(java.lang.String cacheName)
- Reset the cache statistics for the specified cache
- Specified by:
resetCacheStatsin interfaceorg.apache.derby.iapi.store.raw.Transaction
getLogBuffer
public abstract org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream getLogBuffer()
- Get the log buffer to be used during this transaction.
logAndUndo
public abstract void logAndUndo(org.apache.derby.iapi.store.raw.Compensation compensation, org.apache.derby.iapi.store.raw.log.LogInstant undoInstant, org.apache.derby.iapi.services.io.LimitObjectInput in) throws org.apache.derby.iapi.error.StandardException
- Log a compensation operation and then action it in the context of this
transaction.
The CompensationOperation is logged in the transaction log file and
then its doMe method is called to perform the required change. This
compensation operation will rollback the change that was done by the
Loggable Operation at undoInstant.
setTransactionId
public abstract void setTransactionId(org.apache.derby.iapi.store.raw.GlobalTransactionId id, TransactionId shortId)
- Set the transaction Ids (Global and internal) of this transaction
setTransactionId
public abstract void setTransactionId(org.apache.derby.iapi.store.raw.Loggable beginXact, TransactionId shortId)
- Set the transactionId (Global and internal) of this transaction using a
log record that contains the Global id
getId
public abstract TransactionId getId()
- Get the shortId of this transaction. May return null if transactio
has no ID.
getGlobalId
public abstract org.apache.derby.iapi.store.raw.GlobalTransactionId getGlobalId()
- Get the shortId of this transaction. May return null if transactio
has no ID.
- Specified by:
getGlobalIdin interfaceorg.apache.derby.iapi.store.raw.Transaction
addUpdateTransaction
public abstract void addUpdateTransaction(int transactionStatus)
- Add this raw transaction on to the list of update transaction
removeUpdateTransaction
public abstract void removeUpdateTransaction()
- Remove this raw transaction from the list of update transaction
prepareTransaction
public abstract void prepareTransaction()
- Change the state of transaction in table to prepare.
setFirstLogInstant
public abstract void setFirstLogInstant(org.apache.derby.iapi.store.raw.log.LogInstant instant)
- Set the log instant for the first log record written by this
transaction.
getFirstLogInstant
public abstract org.apache.derby.iapi.store.raw.log.LogInstant getFirstLogInstant()
- Get the log instant for the first log record written by this
transaction.
setLastLogInstant
public abstract void setLastLogInstant(org.apache.derby.iapi.store.raw.log.LogInstant instant)
- Set the log instant for the last log record written by this transaction.
getLastLogInstant
public abstract org.apache.derby.iapi.store.raw.log.LogInstant getLastLogInstant()
- Get the log instant for the last log record written by this transaction.
If the transaction is unclear what its last log instant is,
than it may return null.
checkLogicalOperationOk
public void checkLogicalOperationOk()
throws org.apache.derby.iapi.error.StandardException
- Check to see if a logical operation is allowed by this transaction,
throws a TransactionExceotion if it isn't. This implementation allows
logical operations. Transactions that need to disallow logical
operations should hide this method.
recoveryRollbackFirst
public boolean recoveryRollbackFirst()
- Return true if this transaction should be rolled back first
in recovery. This implementation returns false. Transactions that
need to rollback first during recovery should hide this method.
reprepare
public abstract void reprepare()
throws org.apache.derby.iapi.error.StandardException
- During recovery re-prepare a transaction.
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.
setObserverException
public void setObserverException(org.apache.derby.iapi.error.StandardException se)
- Allow an Observer to indicate an exception to the transaction that
is raised in its update() method.
startNestedTopTransaction
public abstract RawTransaction startNestedTopTransaction() throws org.apache.derby.iapi.error.StandardException
- Start a nested top transaction. A nested top transaction behaves exactly
like a user transaction. Nested top transaction allow system type work
to proceed in a separate transaction to the current user transaction
and be committed independently of the user transaction (usually before
the user transaction).
Only one nested top transaction can be active in a context at any one
time.
After a commit the transaction may be re-used.
A nested top transaction conflicts on the logical locks of its "parent"
transaction.
openDroppedContainer
public abstract org.apache.derby.iapi.store.raw.data.RawContainerHandle openDroppedContainer(org.apache.derby.iapi.store.raw.ContainerKey containerId, org.apache.derby.iapi.store.raw.LockingPolicy locking) throws org.apache.derby.iapi.error.StandardException
- Open a container that may be dropped - use only by logging and recovery.
During recovery redo, a log record may refer to a container that has
long been dropped. This interface is provided so a dropped container
may be opened.
If the container has been dropped and is known to be committed, then
even if we open the dropped container with forUpdate true, the
container will be silently opened as read only. Logging and recovery
code always check for committed drop status. Anybody else wanting to
use this interface must keep this in mind.
reCreateContainerForLoadTran
public abstract void reCreateContainerForLoadTran(long segmentId,
long containerId,
org.apache.derby.iapi.util.ByteArray containerInfo)
throws org.apache.derby.iapi.error.StandardException
- Recreate a container during load tran - use only by media recovery.
statusForBeginXactLog
protected abstract int statusForBeginXactLog()
- Status that needs to go into the begin transaction log record, if there
is one, to help with recovery
statusForEndXactLog
protected abstract int statusForEndXactLog()
- Status that needs to go into the end transaction log record, if there
is one, to help with recovery
inAbort
public abstract boolean inAbort()
- Is the transaction in the middle of an abort.
handlesPostTerminationWork
public abstract boolean handlesPostTerminationWork()
- Can this transaction handles post termination work
recoveryTransaction
public abstract void recoveryTransaction()
- Make this transaction aware that it is being used by recovery
notifyObservers
public void notifyObservers(java.lang.Object arg)
- Allow my users to notigy my observers.
inRollForwardRecovery
public abstract boolean inRollForwardRecovery()
- Retunrs true if the transaction is part of rollforward recovery
checkpointInRollForwardRecovery
public abstract void checkpointInRollForwardRecovery(org.apache.derby.iapi.store.raw.log.LogInstant cinstant, long redoLWM) throws org.apache.derby.iapi.error.StandardException
- redo a checkpoint during rollforward recovery
|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> store >> raw >> [ xact overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC