XTA: API Reference for C language

xta_xid.h File Reference
#include <xa.h>
Include dependency graph for xta_xid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  xta_xid_t
 

Functions

int xta_xid_branch_qualifier_is_multibranch (const char *branch_qualifier)
 
int xta_xid_branch_qualifier_set_multibranch (char *branch_qualifier)
 
int xta_xid_branch_qualifier_unset_multibranch (char *branch_qualifier)
 
void xta_xid_delete (xta_xid_t *xid)
 
xta_xid_txta_xid_dup (const xta_xid_t *xid)
 
long xta_xid_get_bqual (const xta_xid_t *xid, char *bqual)
 
long xta_xid_get_formatID (const xta_xid_t *xid)
 
long xta_xid_get_gtrid (const xta_xid_t *xid, char *gtrid)
 
const XIDxta_xid_get_xa_xid (const xta_xid_t *xid)
 
xta_xid_txta_xid_new (const char *branch_qualifier, int multiple_branches)
 
xta_xid_txta_xid_new_from_string (const char *xid_string)
 
xta_xid_txta_xid_new_from_XID (const XID *xid)
 
void xta_xid_reset (xta_xid_t *xid)
 
char * xta_xid_to_string (const xta_xid_t *xid)
 

Function Documentation

int xta_xid_branch_qualifier_is_multibranch ( const char *  branch_qualifier)

Check if a branch_qualifier is related to a multiple branches transaction or not

Parameters
[in]branch_qualifierthat must be checked
Returns
a boolean value: TRUE for multiple branches transaction

Definition at line 110 of file xta_xid.c.

Referenced by xta_transaction_branch(), xta_transaction_commit(), and xta_xid_new().

int xta_xid_branch_qualifier_set_multibranch ( char *  branch_qualifier)

Set branch_qualifier to be a multiple branches transaction

Parameters
[in,out]branch_qualifierthat must be checked
Returns
a boolean value: TRUE if branch_qualifier has been changed

Definition at line 138 of file xta_xid.c.

Referenced by xta_xid_new().

int xta_xid_branch_qualifier_unset_multibranch ( char *  branch_qualifier)

Unset branch_qualifier to be a multiple branches transaction

Parameters
[in,out]branch_qualifierthat must be checked
Returns
a boolean value: TRUE if branch_qualifier has been changed

Definition at line 219 of file xta_xid.c.

Referenced by xta_xid_new().

void xta_xid_delete ( xta_xid_t xid)

Delete a Transaction Identifier object

Parameters
[in]xidobject to delete

Definition at line 432 of file xta_xid.c.

References LIXA_RC_INTERNAL_ERROR, and LIXA_RC_OK.

Referenced by xta_transaction_delete().

xta_xid_t* xta_xid_dup ( const xta_xid_t xid)

Create a new Transaction Identifier object duplicating the passed one

Parameters
[in]xidis the transaction identifier that must be duplicated
Returns
a new transaction identifier object or NULL in the event of an error occurred

Definition at line 385 of file xta_xid.c.

References LIXA_RC_G_TRY_MALLOC_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and xta_xid_t::xa_xid.

long xta_xid_get_bqual ( const xta_xid_t xid,
char *  bqual 
)

This is just a wrapper of lixa_xid_get_bqual

Definition at line 569 of file xta_xid.c.

References xta_xid_t::xa_xid.

long xta_xid_get_formatID ( const xta_xid_t xid)

This is just a wrapper of lixa_xid_get_formatID

Definition at line 575 of file xta_xid.c.

References xta_xid_t::xa_xid.

long xta_xid_get_gtrid ( const xta_xid_t xid,
char *  gtrid 
)

This is just a wrapper of lixa_xid_get_gtrid

Definition at line 563 of file xta_xid.c.

References xta_xid_t::xa_xid.

const XID* xta_xid_get_xa_xid ( const xta_xid_t xid)

Retrieve the transaction ID in the XA standard format

Parameters
[in]xidobject
Returns
a reference to the XA representation of the transaction id

Definition at line 458 of file xta_xid.c.

References LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and xta_xid_t::xa_xid.

Referenced by xta_transaction_branch(), xta_transaction_commit(), xta_transaction_resume(), xta_transaction_rollback(), xta_transaction_start(), and xta_transaction_suspend().

xta_xid_t* xta_xid_new ( const char *  branch_qualifier,
int  multiple_branches 
)

Create a new Transaction Identifier object and generate a new unique XID

Parameters
[in]branch_qualifierthat must be assigned to the XID (in ASCII HEX format)
[in]multiple_branches: boolean value:
TRUE = the created transaction will span more applications, xta_transaction_branch will be called subsequently
FALSE = the created transaction will not span more applications and xta_transaction_branch will not be called for this transaction
Returns
a new transaction identifier object or NULL in the event of an error occurred

Definition at line 47 of file xta_xid.c.

References LIXA_RC_G_TRY_MALLOC_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, LIXA_RC_STRDUP_ERROR, xta_xid_branch_qualifier_is_multibranch(), xta_xid_branch_qualifier_set_multibranch(), and xta_xid_branch_qualifier_unset_multibranch().

Referenced by xta_transaction_start().

xta_xid_t* xta_xid_new_from_string ( const char *  xid_string)

Create a new Transaction Identifier object and set XID as passed by the caller

Parameters
[in]xid_stringa serialized XID, see xta_xid_to_string
Returns
a new transaction identifier object or NULL in the event of an error occurred

Definition at line 291 of file xta_xid.c.

References LIXA_RC_G_TRY_MALLOC_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_MALFORMED_XID, and LIXA_RC_OK.

Referenced by xta_transaction_resume().

xta_xid_t* xta_xid_new_from_XID ( const XID xid)

Create a new Transaction Identifier object and set XID as passed by the caller. This is considered a private method because the an XTA application should not manage the XID struct directly.

Parameters
[in]xida native XA XID
Returns
a new transaction identifier object or NULL in the event of an error occurred

Definition at line 337 of file xta_xid.c.

References LIXA_RC_G_TRY_MALLOC_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, and LIXA_RC_OK.

Referenced by xta_transaction_branch().

void xta_xid_reset ( xta_xid_t xid)

Reset a Transaction identifier object

Parameters
[in,out]xidobject to delete

Definition at line 537 of file xta_xid.c.

References LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, and xta_xid_t::xa_xid.

Referenced by xta_transaction_commit(), and xta_transaction_rollback().

char* xta_xid_to_string ( const xta_xid_t xid)

Convert the transaction ID to an ASCII string

Parameters
[in]xidobject
Returns
a string that must be released using free() function by the caller

Definition at line 491 of file xta_xid.c.

References LIXA_RC_INTERNAL_ERROR, LIXA_RC_MALLOC_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and xta_xid_t::xa_xid.


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