|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.arjuna.ats.arjuna.StateManager com.arjuna.ats.arjuna.coordinator.AbstractRecord com.arjuna.ats.arjuna.LastResourceRecord
AbstractRecord that helps us do the last resource commit optimization. Basically this is something that is used to allow a *single* resource that is only one-phase aware to be enlisted with a transaction that is usually two-phase. The way it works is: (i) the coordinator runs its normal first (prepare) phase on all two-phase aware participants and makes a decision based solely on their responses as to whether to commit or roll back. Note, the one-phase aware resource essentially returns voteCommit during prepare, to ensure that the second phase runs even if all other resources return voteReadOnly. (ii) if the transaction is to commit then the coordinator invokes the second phase on *all* participants, starting with the one that is only one-phase aware. If it rolls back, it rolls all resources back, but the order is not important.
Field Summary |
Fields inherited from class com.arjuna.ats.arjuna.StateManager |
modifyingActions, objectName, objectUid, smAttributes, usingActions |
Constructor Summary | |
protected |
LastResourceRecord()
|
|
LastResourceRecord(OnePhaseResource opr)
|
Method Summary | |
void |
alter(AbstractRecord a)
Alter the current record with the one presented. |
ClassName |
className()
Only used for crash recovery, so most records don't need it. |
static AbstractRecord |
create()
|
void |
merge(AbstractRecord a)
Merge the current record with the one presented. |
int |
nestedAbort()
A rollback of a nested transaction has occurred. |
int |
nestedCommit()
A commit of a nested transaction has occurred. |
int |
nestedPrepare()
Not allowed to participate in nested transactions. |
void |
print(java.io.PrintWriter strm)
Write information about this specific instance to the specified stream. |
boolean |
propagateOnCommit()
Determine if records are discarded on action commit or must be propagated to parents. |
void |
setValue(java.lang.Object o)
|
boolean |
shouldAdd(AbstractRecord a)
Should we add the record presented to the intentions list? |
boolean |
shouldAlter(AbstractRecord a)
Should we alter the current record with the one presented? |
boolean |
shouldMerge(AbstractRecord a)
Should we merge the current record with the one presented? |
boolean |
shouldReplace(AbstractRecord a)
Should we replace the record presented with the current record? |
int |
topLevelAbort()
A rollback of a top-level transaction has occurred. |
int |
topLevelCommit()
A commit of a top-level transaction has occurred. |
int |
topLevelPrepare()
A prepare for a top-level transaction has occurred. |
java.lang.String |
type()
Re-implementation of abstract methods inherited from base class. |
int |
typeIs()
|
java.lang.Object |
value()
If this abstract record caused a heuristic then it should return an object which implements HeuristicInformation |
Methods inherited from class com.arjuna.ats.arjuna.coordinator.AbstractRecord |
create, doSave, equals, forgetHeuristic, getNext, getPrevious, getTypeOfObject, greaterThan, lessThan, nestedCleanup, nestedOnePhaseCommit, order, propagateOnAbort, replace, restore_state, save_state, setNext, setPrevious, topLevelCleanup, topLevelOnePhaseCommit |
Methods inherited from class com.arjuna.ats.arjuna.StateManager |
activate, activate, attributes, cleanup, deactivate, deactivate, deactivate, destroy, disable, finalize, forgetAction, get_uid, getMutex, getStore, getStoreRoot, loadObjectState, lockMutex, modified, ObjectType, packHeader, persist, rememberAction, setStatus, setupStore, setupStore, status, terminate, tryLockMutex, unlockMutex, unpackHeader |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LastResourceRecord(OnePhaseResource opr)
protected LastResourceRecord()
Method Detail |
public boolean propagateOnCommit()
AbstractRecord
propagateOnCommit
in class AbstractRecord
true
if the record should be propagated to the
parent transaction if the current transaction commits,
false
otherwise. The default is true
.public int typeIs()
typeIs
in class AbstractRecord
RecordType
value.public ClassName className()
AbstractRecord
className
in class AbstractRecord
ClassName
to identify this abstract record.public int nestedAbort()
AbstractRecord
nestedAbort
in class AbstractRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int nestedCommit()
AbstractRecord
nestedCommit
in class AbstractRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int nestedPrepare()
nestedPrepare
in class AbstractRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int topLevelAbort()
AbstractRecord
topLevelAbort
in class AbstractRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int topLevelCommit()
AbstractRecord
topLevelCommit
in class AbstractRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int topLevelPrepare()
AbstractRecord
topLevelPrepare
in class AbstractRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public void print(java.io.PrintWriter strm)
AbstractRecord
print
in class AbstractRecord
public java.lang.String type()
AbstractRecord
type
in class AbstractRecord
public boolean shouldAdd(AbstractRecord a)
AbstractRecord
shouldAdd
in class AbstractRecord
true
if the record should be added,
false
otherwise.public boolean shouldMerge(AbstractRecord a)
AbstractRecord
shouldMerge
in class AbstractRecord
true
if the record should be merged,
false
otherwise.public boolean shouldReplace(AbstractRecord a)
AbstractRecord
shouldReplace
in class AbstractRecord
true
if the record should be replaced,
false
otherwise.public boolean shouldAlter(AbstractRecord a)
AbstractRecord
shouldAlter
in class AbstractRecord
true
if the record should be altered,
false
otherwise.public void merge(AbstractRecord a)
AbstractRecord
merge
in class AbstractRecord
public void alter(AbstractRecord a)
AbstractRecord
alter
in class AbstractRecord
public java.lang.Object value()
AbstractRecord
HeuristicInformation
value
in class AbstractRecord
Object
to be used to order.public void setValue(java.lang.Object o)
setValue
in class AbstractRecord
public static AbstractRecord create()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |