Class CommitMarkableResourceRecord
java.lang.Object
com.arjuna.ats.arjuna.StateManager
com.arjuna.ats.arjuna.coordinator.AbstractRecord
com.arjuna.ats.internal.jta.resources.arjunacore.CommitMarkableResourceRecord
The CommitMarkableResourceRecord does not support nested transactions
If the database is down forever that a CommitMarkableResourceRecord is linked
to, it will have the side effect of never expiring a RecoverAtomicAction.
The CommitMarkableResourceRecord assumes the following table has been
created:
syb:
create table xids (xid varbinary(144), transactionManagerID varchar(64),
actionuid varbinary(28))
ora:
create table xids (xid RAW(144), transactionManagerID varchar(64), actionuid
RAW(28))
psql:
create table xids (xid bytea, transactionManagerID varchar(64), actionuid
bytea)
h2:
create table xids (xid varbinary(144), transactionManagerID varchar(64),
actionuid varbinary(28))
sybase notes: sp_configure "lock scheme",0,datarows
-
Field Summary
Fields inherited from class com.arjuna.ats.arjuna.StateManager
modifyingActions, objectModel, objectUid, synchronizationLock, usingActions
-
Constructor Summary
ConstructorDescriptionFor recoveryCommitMarkableResourceRecord
(TransactionImple tx, org.jboss.tm.ConnectableResource xaResource, Xid xid, BasicAction basicAction) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Alter the current record with the one presented.boolean
doSave()
We need to save this so we know there was a ConnectableResource in the intentions list.boolean
Forget any heuristic outcome which this implementation may have produced.int
void
Merge the current record with the one presented.int
A rollback of a nested transaction has occurred.int
A commit of a nested transaction has occurred.int
A prepare for a nested transaction has occurred.order()
Return the Uid of this abstract record so that it can be ordered in the intentions list.boolean
Determine if records are discarded on action commit or must be propagated to parents.boolean
restore_state
(InputObjectState os, int t) During recovery, the transaction log is given to the recovery system and it will recreate a transaction instance to perform necessary recovery actions.boolean
save_state
(OutputObjectState os, int t) When the transaction is required to make the intentions list persistent, it scans the list and asks each record whether or not it requires state to be saved (by calling doSave).void
boolean
Should we add the record presented to the intentions list?boolean
Should we alter the current record with the one presented?boolean
Should we merge the current record with the one presented?boolean
Should we replace the record presented with the current record?int
A rollback of a top-level transaction has occurred.int
A commit of a top-level transaction has occurred.int
Perform a top-level one phase commit.int
This will add the required recovery data about this resource into the resources preparedConnection.type()
Re-implementation of abstract methods inherited from base class.int
typeIs()
void
updateOutcome
(boolean committed) value()
If this abstract record caused a heuristic then it should return an object which implementsHeuristicInformation
Methods inherited from class com.arjuna.ats.arjuna.coordinator.AbstractRecord
clearHeuristicDecision, create, equals, getNext, getPrevious, getTypeOfObject, greaterThan, isPermittedTopLevelOnePhaseCommit, lessThan, nestedCleanup, nestedOnePhaseCommit, print, propagateOnAbort, replace, setNext, setPrevious, topLevelCleanup
Methods inherited from class com.arjuna.ats.arjuna.StateManager
activate, activate, cleanup, createLists, deactivate, deactivate, deactivate, destroy, disable, forgetAction, get_uid, getCreationTimeMillis, getMutex, getObjectModel, getStore, getStoreRoot, loadObjectState, lockMutex, modified, objectType, packHeader, persist, rememberAction, setStatus, setupStore, setupStore, setupStore, status, terminate, tryLockMutex, unlockMutex, unpackHeader
-
Constructor Details
-
CommitMarkableResourceRecord
public CommitMarkableResourceRecord()For recovery -
CommitMarkableResourceRecord
public CommitMarkableResourceRecord(TransactionImple tx, org.jboss.tm.ConnectableResource xaResource, Xid xid, BasicAction basicAction) throws IllegalStateException, jakarta.transaction.RollbackException, jakarta.transaction.SystemException - Throws:
IllegalStateException
jakarta.transaction.RollbackException
jakarta.transaction.SystemException
-
-
Method Details
-
getProductName
-
getProductVersion
-
getJndiName
-
updateOutcome
public void updateOutcome(boolean committed) -
doSave
public boolean doSave()We need to save this so we know there was a ConnectableResource in the intentions list.- Overrides:
doSave
in classAbstractRecord
- Returns:
true
if it should be saved,false
otherwise.false
is the default.
-
save_state
Description copied from class:AbstractRecord
When the transaction is required to make the intentions list persistent, it scans the list and asks each record whether or not it requires state to be saved (by calling doSave). If the answer is yes, then save_state is called and the record instance must save enough information to enable it to be restored from that state later. The basic AbstractRecord save_state will save common data that is required by the base class during recovery. If a derived class calls super.save_state then it must be called before packing any other data item.- Overrides:
save_state
in classAbstractRecord
- Returns:
true
if successful,false
otherwise.
-
restore_state
Description copied from class:AbstractRecord
During recovery, the transaction log is given to the recovery system and it will recreate a transaction instance to perform necessary recovery actions. This transaction will recreate the intentions list and give each recreated AbstractRecord the state that that was saved during transaction persistence. The base class will restore information that it needs from the log. Data items must be unpacked in the same order that they were packed.- Overrides:
restore_state
in classAbstractRecord
- Returns:
true
if successful,false
otherwise.
-
topLevelPrepare
public int topLevelPrepare()This will add the required recovery data about this resource into the resources preparedConnection. If the preparedConnection is in read only mode, we do not need to persist this information.- Specified by:
topLevelPrepare
in classAbstractRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
topLevelAbort
public int topLevelAbort()Description copied from class:AbstractRecord
A rollback of a top-level transaction has occurred.- Specified by:
topLevelAbort
in classAbstractRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
topLevelCommit
public int topLevelCommit()Description copied from class:AbstractRecord
A commit of a top-level transaction has occurred.- Specified by:
topLevelCommit
in classAbstractRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
topLevelOnePhaseCommit
public int topLevelOnePhaseCommit()Description copied from class:AbstractRecord
Perform a top-level one phase commit.- Overrides:
topLevelOnePhaseCommit
in classAbstractRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
forgetHeuristic
public boolean forgetHeuristic()Description copied from class:AbstractRecord
Forget any heuristic outcome which this implementation may have produced.- Overrides:
forgetHeuristic
in classAbstractRecord
- Returns:
true
by default. Iffalse
is returned then the instance must be remembered by the transaction (in the log) in order for recovery to retry later or for a system administrator to be able to determine which resources have not been successfully completed.
-
getHeuristic
public int getHeuristic() -
order
Description copied from class:AbstractRecord
Return the Uid of this abstract record so that it can be ordered in the intentions list. This is also the Uid that the record was saved with in the object store.- Overrides:
order
in classAbstractRecord
- Returns:
Uid
for this instance.- See Also:
-
propagateOnCommit
public boolean propagateOnCommit()Description copied from class:AbstractRecord
Determine if records are discarded on action commit or must be propagated to parents.- Overrides:
propagateOnCommit
in classAbstractRecord
- Returns:
true
if the record should be propagated to the parent transaction if the current transaction commits,false
otherwise. The default istrue
.
-
typeIs
public int typeIs()- Specified by:
typeIs
in classAbstractRecord
- Returns:
RecordType
value.
-
type
Description copied from class:AbstractRecord
Re-implementation of abstract methods inherited from base class.- Overrides:
type
in classAbstractRecord
-
value
Description copied from class:AbstractRecord
If this abstract record caused a heuristic then it should return an object which implementsHeuristicInformation
- Specified by:
value
in classAbstractRecord
- Returns:
Object
to be used to order.
-
setValue
- Specified by:
setValue
in classAbstractRecord
-
nestedAbort
public int nestedAbort()Description copied from class:AbstractRecord
A rollback of a nested transaction has occurred.- Specified by:
nestedAbort
in classAbstractRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
nestedCommit
public int nestedCommit()Description copied from class:AbstractRecord
A commit of a nested transaction has occurred.- Specified by:
nestedCommit
in classAbstractRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
nestedPrepare
public int nestedPrepare()Description copied from class:AbstractRecord
A prepare for a nested transaction has occurred.- Specified by:
nestedPrepare
in classAbstractRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
merge
Description copied from class:AbstractRecord
Merge the current record with the one presented.- Specified by:
merge
in classAbstractRecord
- Parameters:
a
- the record with which to merge.
-
alter
Description copied from class:AbstractRecord
Alter the current record with the one presented.- Specified by:
alter
in classAbstractRecord
- Parameters:
a
- the record with which to alter.
-
shouldAdd
Description copied from class:AbstractRecord
Should we add the record presented to the intentions list?- Specified by:
shouldAdd
in classAbstractRecord
- Parameters:
a
- The record to try to add.- Returns:
true
if the record should be added,false
otherwise.
-
shouldAlter
Description copied from class:AbstractRecord
Should we alter the current record with the one presented?- Specified by:
shouldAlter
in classAbstractRecord
- Parameters:
a
- The record to try to alter.- Returns:
true
if the record should be altered,false
otherwise.
-
shouldMerge
Description copied from class:AbstractRecord
Should we merge the current record with the one presented?- Specified by:
shouldMerge
in classAbstractRecord
- Parameters:
a
- The record to try to merge.- Returns:
true
if the record should be merged,false
otherwise.
-
shouldReplace
Description copied from class:AbstractRecord
Should we replace the record presented with the current record?- Specified by:
shouldReplace
in classAbstractRecord
- Parameters:
a
- The record to try to replace.- Returns:
true
if the record should be replaced,false
otherwise.
-