Package org.datanucleus.transaction
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 boolean
has completing started ?private List
<XAResource> enlisted XAResource resourcesprivate final String
private static int
sequence number for global transactionsprivate int
number for next branchprivate static final int
id of this instancestatic final Random
Random number generator, for use when needing unique names.private int
transaction 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 int
private Map
<XAResource, Xid> suspended branchesprivate List
<Synchronization> Synchonizationprivate final Xid
transaction id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
boolean
delistResource
(XAResource xaRes, int flag) boolean
enlistResource
(XAResource xaRes) int
static String
getXAErrorCode
(Throwable xae) private static String
getXAFlag
(int flag) boolean
isEnlisted
(XAResource xaRes) void
void
rollback()
void
toString()
-
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