XTA: API Reference for C language

xta_xa_resource.c File Reference
#include "config.h"
#include "lixa_errors.h"
#include "lixa_trace.h"
#include "xta_xa_resource.h"
Include dependency graph for xta_xa_resource.c:

Go to the source code of this file.

Macros

#define LIXA_TRACE_MODULE   LIXA_TRACE_MOD_XTA
 

Functions

void xta_xa_resource_clean (xta_xa_resource_t *xa_resource)
 
int xta_xa_resource_commit (xta_xa_resource_t *xa_resource, const xta_xid_t *xid, int one_phase)
 
int xta_xa_resource_end (xta_xa_resource_t *xa_resource, const xta_xid_t *xid, long flag)
 
int xta_xa_resource_enlisted (xta_xa_resource_t *xa_resource, const xta_transaction_t *tx)
 
const xta_xa_resource_config_txta_xa_resource_get_config (const xta_xa_resource_t *xa_resource)
 
int xta_xa_resource_init (xta_xa_resource_t *xa_resource, int native)
 
int xta_xa_resource_prepare (xta_xa_resource_t *xa_resource, const xta_xid_t *xid)
 
int xta_xa_resource_start (xta_xa_resource_t *xa_resource, const xta_xid_t *xid, long flag)
 

Macro Definition Documentation

#define LIXA_TRACE_MODULE   LIXA_TRACE_MOD_XTA

Definition at line 42 of file xta_xa_resource.c.

Function Documentation

void xta_xa_resource_clean ( xta_xa_resource_t xa_resource)

Clean the properties of a XA Resource; this function must be called after xta_xa_resource_init during object disposition to avoid memory leaks

Parameters
[in,out]xa_resource: XA Resource object

Definition at line 184 of file xta_xa_resource.c.

References LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, and LIXA_RC_OK.

Referenced by xta_native_xa_resource_clean().

int xta_xa_resource_commit ( xta_xa_resource_t xa_resource,
const xta_xid_t xid,
int  one_phase 
)

Commits the global transaction specified by xid.

Parameters
[in,out]xa_resource: resource object
[in]xid: transaction identifier object
[in]one_phase: if true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid
Returns
a reason code

Definition at line 296 of file xta_xa_resource.c.

References LIXA_RC_INTERNAL_ERROR, and LIXA_RC_OK.

int xta_xa_resource_end ( xta_xa_resource_t xa_resource,
const xta_xid_t xid,
long  flag 
)

Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource from the transaction branch specified and lets the transaction complete. If TMSUSPEND is specified in the flags, the transaction branch is temporarily suspended in an incomplete state. The transaction context is in a suspended state and must be resumed via the start method with TMRESUME specified. If TMFAIL is specified, the portion of work has failed. The resource manager may mark the transaction as rollback-only. If TMSUCCESS is specified, the portion of work has completed successfully.

Parameters
[in,out]xa_resource: resource object
[in]xid: transaction identifier object
[in]flag: one of TMSUCCESS, TMFAIL, or TMSUSPEND
Returns
a reason code

Definition at line 243 of file xta_xa_resource.c.

References LIXA_RC_INTERNAL_ERROR, and LIXA_RC_OK.

int xta_xa_resource_enlisted ( xta_xa_resource_t xa_resource,
const xta_transaction_t tx 
)

This call back method is invoked by a Transaction Manager when an Application Program enlists an XA Resource to a Transaction Manager. The TM calls back the XA Resource to notify it has been registered.

Parameters
[in,out]xa_resource: XA Resource object
[in]tx: XA Transaction
Returns
a reason code

Definition at line 127 of file xta_xa_resource.c.

References xta_xa_resource_s::enlisted_tx, LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and LIXA_RC_RESOURCE_ALREADY_REGISTERED.

Referenced by xta_transaction_enlist_resource().

const xta_xa_resource_config_t* xta_xa_resource_get_config ( const xta_xa_resource_t xa_resource)

Return a reference (a pointer) to the configuration parameters of the resource.

Parameters
[in]xa_resource: XA Resource object
Returns
a pointer to the resource configuration record

Definition at line 90 of file xta_xa_resource.c.

References xta_xa_resource_s::act_rsrmgr_config, LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, and LIXA_RC_OK.

Referenced by xta_transaction_enlist_resource().

int xta_xa_resource_init ( xta_xa_resource_t xa_resource,
int  native 
)

Initialize the common properties of XA Resources

Parameters
[in,out]xa_resource: XA Resource object
[in]native: TRUE, the XA Resource uses an XA native interface
FALSE, the XA Resource uses an XTA interface
Returns
a reason code

Definition at line 46 of file xta_xa_resource.c.

References xta_xa_resource_s::act_rsrmgr_config, xta_xa_resource_s::dynamic, xta_xa_resource_s::enlisted_tx, lixa_iface_reset(), LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and xta_xa_resource_s::rsrmgr_config.

Referenced by xta_acquired_xa_resource_init(), and xta_native_xa_resource_init().

int xta_xa_resource_prepare ( xta_xa_resource_t xa_resource,
const xta_xid_t xid 
)

Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.

Parameters
[in,out]xa_resource: resource object
[in]xid: transaction identifier object
Returns
a reason code

Definition at line 270 of file xta_xa_resource.c.

References LIXA_RC_INTERNAL_ERROR, and LIXA_RC_OK.

int xta_xa_resource_start ( xta_xa_resource_t xa_resource,
const xta_xid_t xid,
long  flag 
)

Starts work on behalf of a transaction branch specified in xid. If TMJOIN is specified, the start applies to joining a transaction previously seen by the resource manager. If TMRESUME is specified, the start applies to resuming a suspended transaction specified in the parameter xid.

Parameters
[in,out]xa_resource: resource object
[in]xid: transaction identifier object
[in]flag: one of TMNOFLAGS, TMJOIN, or TMRESUME
Returns
a reason code

Definition at line 216 of file xta_xa_resource.c.

References LIXA_RC_INTERNAL_ERROR, and LIXA_RC_OK.


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