public class TransactionResourceManager extends Object
TransactionResourceManager
registry for transaction contexts.Modifier and Type | Method and Description |
---|---|
void |
beginXATransaction(String transactionId,
int transactionBlockId,
XAResource xaResource)
This method starts a transaction for the given xa resource.
|
static TransactionResourceManager |
getInstance() |
boolean |
notifyAbort(String transactionId,
int transactionBlockId,
boolean isRetryAttempt)
This method acts as the callback which aborts all the resources participated in the given transaction.
|
boolean |
notifyCommit(String transactionId,
int transactionBlockId)
This method acts as the callback which commits all the resources participated in the given transaction.
|
boolean |
prepare(String transactionId,
int transactionBlockId)
This method acts as the callback which notify all the resources participated in the given transaction.
|
void |
register(String transactionId,
int transactionBlockId,
BallerinaTransactionContext txContext)
This method will register connection resources with a particular transaction.
|
void |
registerAbortedFunction(int transactionBlockId,
BFunctionPointer bFunctionPointer)
This method will register an aborted function handler of a particular transaction.
|
void |
registerCommittedFunction(int transactionBlockId,
BFunctionPointer bFunctionPointer)
This method will register a committed function handler of a particular transaction.
|
public static TransactionResourceManager getInstance()
public void register(String transactionId, int transactionBlockId, BallerinaTransactionContext txContext)
transactionId
- the global transaction idtransactionBlockId
- the block id of the transactiontxContext
- ballerina transaction context which includes the underlying connection infopublic void registerCommittedFunction(int transactionBlockId, BFunctionPointer bFunctionPointer)
transactionBlockId
- the block id of the transactionbFunctionPointer
- the function pointer for the committed functionpublic void registerAbortedFunction(int transactionBlockId, BFunctionPointer bFunctionPointer)
transactionBlockId
- the block id of the transactionbFunctionPointer
- the function pointer for the aborted functionpublic boolean prepare(String transactionId, int transactionBlockId)
transactionId
- the global transaction idtransactionBlockId
- the block id of the transactionpublic boolean notifyCommit(String transactionId, int transactionBlockId)
transactionId
- the global transaction idtransactionBlockId
- the block id of the transactionpublic boolean notifyAbort(String transactionId, int transactionBlockId, boolean isRetryAttempt)
transactionId
- the global transaction idtransactionBlockId
- the block id of the transactionisRetryAttempt
- whether this is a retry attemptpublic void beginXATransaction(String transactionId, int transactionBlockId, XAResource xaResource)
transactionId
- the global transaction idtransactionBlockId
- the block id of the transactionxaResource
- the XA resource which participates in the transactionCopyright © 2018 WSO2. All rights reserved.