#include <Transaction.hpp>
Public Member Functions | |
void | branch (const string &XidString) |
void | commit (bool NonBlocking=false) |
void | enlistResource (XaResource *xaRes) |
Config & | getConfig () |
Xid | getXid () |
void | recover (void) |
void | resume (const string &XidString, long Flags=TMRESUME) |
void | rollback (void) |
void | start (bool MultipleBranches=false) |
void | suspend (long Flags=TMMIGRATE) |
Transaction (xta_transaction_t *tx) | |
~Transaction () | |
Private Attributes | |
Config | config |
xta_transaction_t * | tx |
XTA Transaction class
Definition at line 43 of file Transaction.hpp.
xta::Transaction::Transaction | ( | xta_transaction_t * | tx | ) |
A Transaction object can be created only if the base C object has been already created (this is just a wrapper, not a native C++ implementation)
Definition at line 37 of file Transaction.cpp.
xta::Transaction::~Transaction | ( | ) |
Destructor must be called only by the TransactionManager class; if called directly by the customer program, it will just nullify the pointer to the underlaying C object
Definition at line 43 of file Transaction.cpp.
References tx.
void xta::Transaction::branch | ( | const string & | XidString | ) |
Create a new branch of the transaction represented by xid in this transaction object; the global transaction has been previously started
[in] | XidString | serialized identifier of the global transaction that must be branched |
Definition at line 103 of file Transaction.cpp.
References tx.
void xta::Transaction::commit | ( | bool | NonBlocking = false | ) |
Commit the transaction represented by this transaction object
[in] | NonBlocking | boolean value: true = xa_prepare will not block the caller false = xa_prepare will block the caller the option is used only for multiple branch transactions |
Definition at line 66 of file Transaction.cpp.
References tx.
void xta::Transaction::enlistResource | ( | XaResource * | xaRes | ) |
Enlist the resource specified with the Transaction associated with the Transaction object
[in] | xaRes | : resource to associate |
Definition at line 50 of file Transaction.cpp.
References xta::XaResource::getCBaseXaResource(), and tx.
Config & xta::Transaction::getConfig | ( | ) |
Retrieve the current configuration of the transaction
Definition at line 118 of file Transaction.cpp.
References config.
Xid xta::Transaction::getXid | ( | ) |
Retrieve a Xid, transaction identifier object. NOTE: the object contains a reference (a pointer) to the underlying C structure and can NOT be used outside the scope of the Transaction object
Definition at line 110 of file Transaction.cpp.
References tx.
void xta::Transaction::recover | ( | void | ) |
void xta::Transaction::resume | ( | const string & | XidString, |
long | Flags = TMRESUME |
||
) |
Resume the transaction represented by xid in this transaction object; the transaction has been previously suspended with suspend
[in] | XidString | serialized identifier of the transaction that must be resumed |
[in] | Flags | can be TMRESUME if the transaction has been suspended using TMMIGRATE or TMJOIN if the transaction has been suspended using TMNOFLAGS |
Definition at line 88 of file Transaction.cpp.
References tx.
void xta::Transaction::rollback | ( | void | ) |
Rollback the transaction represented by this transaction object
Definition at line 74 of file Transaction.cpp.
References tx.
void xta::Transaction::start | ( | bool | MultipleBranches = false | ) |
Start a new XA Transaction. From the XA specification point of view, it calls xa_start (for the Native XA Resource Managers)
[in] | MultipleBranches | : boolean value: true = the created transaction will span more applications, branch will be called subsequently false = the created transaction will not span more applications and branch will not be called for this transaction |
Definition at line 58 of file Transaction.cpp.
References tx.
void xta::Transaction::suspend | ( | long | Flags = TMMIGRATE | ) |
Suspend the transaction represented by this transaction object; the transaction can be resumed with resume at a later time
[in] | Flags | can be TMMIGRATE if the Resource Manager supports transaction migration and TMNOFLAGS otherwise |
Definition at line 81 of file Transaction.cpp.
References tx.
|
private |
Configuration is a local object because it contains a referenct to the underlying C structure and is returned as reference by getConfig
Definition at line 144 of file Transaction.hpp.
Referenced by getConfig(), and Transaction().
|
private |
Pointer to the native C object
Definition at line 138 of file Transaction.hpp.
Referenced by branch(), commit(), enlistResource(), getXid(), recover(), resume(), rollback(), start(), suspend(), Transaction(), and ~Transaction().