Class ResourcedTransaction
java.lang.Object
org.datanucleus.transaction.ResourcedTransaction
Transaction allowing resources to be enlisted, with branches and phased commit, following the style of an Open/XA transaction.
Enlisted resources are typically datastore resources which, in turn, need committing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<XAResource, Xid> active branches are resources that have not ended and are not suspendedprivate Map<Xid, XAResource> branches - each resource is a new branchprivate booleanhas completing started ?private List<XAResource> enlisted XAResource resourcesprivate final Stringprivate static intsequence number for global transactionsprivate intnumber for next branchprivate static final intid of this instancestatic final RandomRandom number generator, for use when needing unique names.private inttransaction status(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final intprivate Map<XAResource, Xid> suspended branchesprivate List<Synchronization> Synchonizationprivate final Xidtransaction id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()booleandelistResource(XAResource xaRes, int flag) booleanenlistResource(XAResource xaRes) intstatic StringgetXAErrorCode(Throwable xae) private static StringgetXAFlag(int flag) booleanisEnlisted(XAResource xaRes) voidvoidrollback()voidtoString()
-
Field Details
-
random
Random number generator, for use when needing unique names. -
STATUS_ACTIVE
static final int STATUS_ACTIVE- See Also:
-
STATUS_MARKED_ROLLBACK
static final int STATUS_MARKED_ROLLBACK- See Also:
-
STATUS_PREPARED
static final int STATUS_PREPARED- See Also:
-
STATUS_COMMITTED
static final int STATUS_COMMITTED- See Also:
-
STATUS_ROLLEDBACK
static final int STATUS_ROLLEDBACK- See Also:
-
STATUS_UNKNOWN
static final int STATUS_UNKNOWN- See Also:
-
STATUS_NO_TRANSACTION
static final int STATUS_NO_TRANSACTION- See Also:
-
STATUS_PREPARING
static final int STATUS_PREPARING- See Also:
-
STATUS_COMMITTING
static final int STATUS_COMMITTING- See Also:
-
STATUS_ROLLING_BACK
static final int STATUS_ROLLING_BACK- See Also:
-
NODE_ID
private static final int NODE_IDid of this instance -
NEXT_GLOBAL_TRANSACTION_ID
private static int NEXT_GLOBAL_TRANSACTION_IDsequence number for global transactions -
nextBranchId
private int nextBranchIdnumber for next branch -
xid
transaction id -
status
private int statustransaction status -
completing
private boolean completinghas completing started ? -
synchronization
Synchonization -
enlistedResources
enlisted XAResource resources -
branches
branches - each resource is a new branch -
activeBranches
active branches are resources that have not ended and are not suspended -
suspendedResources
suspended branches -
idString
-
-
Constructor Details
-
ResourcedTransaction
ResourcedTransaction()
-
-
Method Details
-
getStatus
public int getStatus() -
isEnlisted
-
enlistResource
-
delistResource
-
registerSynchronization
-
commit
public void commit() -
rollback
public void rollback() -
setRollbackOnly
public void setRollbackOnly() -
getXAErrorCode
-
getXAFlag
-
toString
-