Class RecoveredTransaction
java.lang.Object
com.arjuna.ats.arjuna.StateManager
com.arjuna.ats.arjuna.coordinator.BasicAction
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator
com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple
com.arjuna.ats.internal.jts.recovery.transactions.RecoveredTransaction
- All Implemented Interfaces:
ArjunaTransactionOperations
,UidCoordinatorOperations
,Reapable
,RecoveringTransaction
,CoordinatorOperations
,TerminatorOperations
- Direct Known Subclasses:
AssumedCompleteHeuristicTransaction
,AssumedCompleteTransaction
,RecoveredTransactionWrapper
Transaction type only instantiated at recovery time. This is used to
re-activate the state of a root (non-interposed) transaction that did not
terminate correctly due to failure.
- Version:
- $Id: RecoveredTransaction.java 2342 2006-03-30 13:06:17Z $
- Author:
- Dave Ingham (dave@arjuna.com)
-
Field Summary
Fields inherited from class com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple
controlHandle, parentTransaction
Fields inherited from class com.arjuna.ats.arjuna.coordinator.BasicAction
failedList, heuristicList, pendingList, preparedList, readonlyList, savedIntentionList, subordinate, threadStackTraceHistoryList
Fields inherited from class com.arjuna.ats.arjuna.StateManager
modifyingActions, objectModel, objectUid, synchronizationLock, usingActions
-
Constructor Summary
ConstructorDescriptionRecoveredTransaction
(Uid actionUid) RecoveredTransaction
(Uid actionUid, String changedTypeName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResourceRecord
(Uid rcUid, Resource r) Allows a new Resource to be added to the transaction.boolean
boolean
Tell transaction it is assumed to be complete and should convert itself to the appropriate assumed complete type.Get the status of the transaction.do not admit to being inactiveint
Get the status of recovery for this transactionprotected void
packHeader
(OutputObjectState os, com.arjuna.ats.internal.arjuna.Header hdr) Override StateManager packHeader so it gets the original processUid, not this process'svoid
void
Causes phase 2 of the commit protocol to be replayed.boolean
save_state
(OutputObjectState objectState, int ot) Redefined version of save_state and restore_state from StateManager.type()
Overloads BasicAction.type()protected void
unpackHeader
(InputObjectState os, com.arjuna.ats.internal.arjuna.Header hdr) Override StateManager's unpackHeader to save the processUid of the original processMethods inherited from class com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple
commit, create_subtransaction, createOTSRecord, createOTSRecord, destroyAction, doAfterCompletion, doBeforeCompletion, equals, finalize, forgetHeuristics, get_parent_status, get_top_level_status, get_transaction_name, get_txcontext, getControlHandle, getSynchronizations, hash_top_level_tran, hash_transaction, interpositionType, is_ancestor_transaction, is_descendant_transaction, is_related_transaction, is_same_transaction, is_top_level_transaction, register_resource, register_subtran_aware, register_synchronization, rollback, rollback_only, setControlHandle, topLevelUid, toString, typeName, uid
Methods inherited from class com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator
addSynchronization, afterCompletion, afterCompletion, asyncAfterCompletion, beforeCompletion, cancel, end, getDeferredThrowable, outputCapturedStackTraces, recordStackTraces, running, start, start
Methods inherited from class com.arjuna.ats.arjuna.coordinator.BasicAction
Abort, Abort, abortStatus, activate, activate, activeThreads, add, addChildAction, addChildThread, addChildThread, addRecord, async_prepare, Begin, checkForCurrent, childTransactions, commitStatus, createStackTraces, criticalEnd, criticalStart, Current, deactivate, destroy, doAbort, doAbort, doCommit, doCommit, doPrepare, End, finalizeInternal, getDeferredThrowables, getHeuristicDecision, getHierarchy, getSavingUid, getStore, hashCode, hierarchyDepth, insertRecord, isAncestor, maintainHeuristics, onePhaseCommit, onePhaseCommit, parent, phase2Abort, phase2Cleanup, phase2Commit, prepare, preparedStatus, preventCommit, removeChildAction, removeChildThread, removeChildThread, restore_state, setCheckedAction, setHeuristicDecision, status, topLevelAction, topLevelActionUid, typeOfAction, updateHeuristic, updateState
Methods inherited from class com.arjuna.ats.arjuna.StateManager
cleanup, createLists, deactivate, deactivate, disable, forgetAction, get_uid, getCreationTimeMillis, getMutex, getObjectModel, getStoreRoot, loadObjectState, lockMutex, modified, objectType, persist, print, rememberAction, setStatus, setupStore, setupStore, setupStore, terminate, tryLockMutex, unlockMutex
Methods inherited from interface com.arjuna.ats.arjuna.coordinator.Reapable
get_uid, preventCommit
-
Field Details
-
_originalProcessUid
-
-
Constructor Details
-
RecoveredTransaction
-
RecoveredTransaction
-
-
Method Details
-
get_status
Get the status of the transaction. If we successfully activated the transaction then we return whatever the transaction reports otherwise we return RolledBack as we're using presumed abort.- Specified by:
get_status
in interfaceCoordinatorOperations
- Specified by:
get_status
in interfaceRecoveringTransaction
- Overrides:
get_status
in classArjunaTransactionImple
- Throws:
org.omg.CORBA.SystemException
-
getOriginalStatus
- Specified by:
getOriginalStatus
in interfaceRecoveringTransaction
-
addResourceRecord
Allows a new Resource to be added to the transaction. Typically this is used to replace a Resource that has failed and cannot be recovered on it's original IOR.- Specified by:
addResourceRecord
in interfaceRecoveringTransaction
-
replayPhase2
public void replayPhase2()Causes phase 2 of the commit protocol to be replayed.- Specified by:
replayPhase2
in interfaceRecoveringTransaction
-
getRecoveryStatus
public int getRecoveryStatus()Get the status of recovery for this transaction- Specified by:
getRecoveryStatus
in interfaceRecoveringTransaction
-
allCompleted
public boolean allCompleted()- Specified by:
allCompleted
in interfaceRecoveringTransaction
-
type
Description copied from class:TwoPhaseCoordinator
Overloads BasicAction.type()- Specified by:
type
in interfaceRecoveringTransaction
- Overrides:
type
in classArjunaTransactionImple
-
removeOldStoreEntry
public void removeOldStoreEntry()- Specified by:
removeOldStoreEntry
in interfaceRecoveringTransaction
-
assumeComplete
public boolean assumeComplete()Description copied from interface:RecoveringTransaction
Tell transaction it is assumed to be complete and should convert itself to the appropriate assumed complete type.- Specified by:
assumeComplete
in interfaceRecoveringTransaction
-
packHeader
protected void packHeader(OutputObjectState os, com.arjuna.ats.internal.arjuna.Header hdr) throws IOException Override StateManager packHeader so it gets the original processUid, not this process's- Overrides:
packHeader
in classStateManager
- Throws:
IOException
- Since:
- JTS 2.1.
-
unpackHeader
protected void unpackHeader(InputObjectState os, com.arjuna.ats.internal.arjuna.Header hdr) throws IOException Override StateManager's unpackHeader to save the processUid of the original process- Overrides:
unpackHeader
in classStateManager
- Parameters:
os
- the identity of the transaction that last caused the state to be written to the object store.- Throws:
IOException
- Since:
- JTS 2.1.
-
save_state
Description copied from class:BasicAction
Redefined version of save_state and restore_state from StateManager. Normal operation (no crashes): BasicAction.save_state is called after a successful prepare. This causes and BasicAction object to be saved in the object store. This object contains primarily the "intentions list" of the BasicAction. After successfully completing phase 2 of the commit protocol, the BasicAction object is deleted from the store. Failure cases: If a server crashes after successfully preparing, then upon recovery the action must be resolved (either committed or aborted) depending upon whether the co-ordinating atomic action committed or aborted. Upon server recovery, the crash recovery mechanism detects ServerBasicAction objects in the object store and attempts to activate the BasicAction object of the co-ordinating action. If this is successful then the SAA is committed else aborted. If, when processing phase 2 of the commit protocol, the co-ordinator experiences a failure to commit from one of the records then the BasicAction object is NOT deleted. It is rewritten when a new state which contains a list of the records that failed during phase 2 commit. This list is called the "failedList". The crash recovery manager will detect local BasicAction objects in addition to SAA objects in the objectstore. An attempt will be made to commit these actions. If the action contained a call to a now dead server, this action can never be resolved and the AA object can never be removed. However, if the action is purely local then after the processing is complete the removed by crash recovery.- Overrides:
save_state
in classBasicAction
- Returns:
true
if successful,false
otherwise.
-
getLastActiveTime
do not admit to being inactive- Specified by:
getLastActiveTime
in interfaceRecoveringTransaction
-