XTA: API Reference for C++ language

xta::Transaction Class Reference

#include <Transaction.hpp>

Collaboration diagram for xta::Transaction:

Public Member Functions

void branch (const string &XidString)
 
void commit (bool NonBlocking=false)
 
void enlistResource (XaResource *xaRes)
 
ConfiggetConfig ()
 
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
 

Detailed Description

XTA Transaction class

Definition at line 43 of file Transaction.hpp.

Constructor & Destructor Documentation

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.

References config, and tx.

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.

Member Function Documentation

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

Parameters
[in]XidStringserialized 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

Parameters
[in]NonBlockingboolean 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

Parameters
[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  )

Explicitly open and close all the enlisted resource to look for recovery pending transaction in the LIXA state server. In normal condition, this is not necessary, because the same happens when start, resume and branch are called

Definition at line 96 of file Transaction.cpp.

References tx.

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

Parameters
[in]XidStringserialized identifier of the transaction that must be resumed
[in]Flagscan 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)

Parameters
[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

Parameters
[in]Flagscan be TMMIGRATE if the Resource Manager supports transaction migration and TMNOFLAGS otherwise

Definition at line 81 of file Transaction.cpp.

References tx.

Member Data Documentation

Config xta::Transaction::config
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().

xta_transaction_t* xta::Transaction::tx
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().


The documentation for this class was generated from the following files:

Copyright © 2009-2019, Christian Ferrari tiian@users.sourceforge.net http://www.tiian.org/