Go to the source code of this file.
Data Structures | |
struct | xta_transaction_s |
Typedefs | |
typedef void | xta_transaction_client_status_t |
typedef struct xta_transaction_s | xta_transaction_t |
typedef struct xta_xa_resource_s | xta_xa_resource_t |
typedef void xta_transaction_client_status_t |
This typedef are necessary to avoid the inclusion of LIXA internals that are unnecessary for the XTA interface, but necessary for XTA implementation. The real type is client_status_t, by XTA is used only as a pointer
Definition at line 36 of file xta_transaction.h.
typedef struct xta_transaction_s xta_transaction_t |
XTA Transaction data type
typedef struct xta_xa_resource_s xta_xa_resource_t |
Definition at line 45 of file xta_transaction.h.
int xta_transaction_branch | ( | xta_transaction_t * | transact, |
const char * | xid_string | ||
) |
Create a new branch of the transaction represented by xid in this transaction object; the global transaction has been previously started
[in,out] | transact | : transaction object |
[in] | xid_string | serialized identifier of the global transaction that must be branched |
Definition at line 1390 of file xta_transaction.c.
References xta_transaction_s::already_opened, xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_MALFORMED_XID, LIXA_RC_NO_SUPERIOR_BRANCH, LIXA_RC_NON_BRANCHABLE_TX, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, xta_transaction_s::local_ccc, TMXTABRANCH, xta_transaction_s::xid, xta_transaction_open_internal(), xta_xid_branch_qualifier_is_multibranch(), xta_xid_get_xa_xid(), and xta_xid_new_from_XID().
int xta_transaction_close | ( | xta_transaction_t * | transact | ) |
Definition at line 626 of file xta_transaction.c.
References xta_transaction_close_internal().
int xta_transaction_close_internal | ( | xta_transaction_t * | transact | ) |
Definition at line 633 of file xta_transaction.c.
References xta_transaction_s::already_opened, xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, LIXA_RC_PROTOCOL_ERROR, and xta_transaction_s::local_ccc.
Referenced by xta_transaction_close(), xta_transaction_delete(), and xta_transaction_recover().
int xta_transaction_commit | ( | xta_transaction_t * | transact, |
int | non_blocking | ||
) |
Commit the transaction represented by this transaction object
[in,out] | transact | : transaction object |
[in] | non_blocking | 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 838 of file xta_transaction.c.
References xta_transaction_s::client_status, xta_transaction_s::commit_suspended, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, LIXA_RC_OTHER_BRANCH_ERROR, LIXA_RC_TX_HAZARD, LIXA_RC_TX_MIXED, LIXA_RC_TX_ROLLBACK, LIXA_RC_WOULD_BLOCK, xta_transaction_s::local_ccc, TMSUCCESS, xta_transaction_s::xid, xta_xid_branch_qualifier_is_multibranch(), xta_xid_get_xa_xid(), and xta_xid_reset().
void xta_transaction_delete | ( | xta_transaction_t * | transact | ) |
Delete a Transaction object
[in] | transact | : transaction object to delete |
Definition at line 184 of file xta_transaction.c.
References xta_transaction_s::already_opened, xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, xta_transaction_s::local_ccc, xta_transaction_s::xid, xta_transaction_close_internal(), and xta_xid_delete().
Referenced by xta_transaction_manager_create_transaction().
int xta_transaction_enlist_resource | ( | xta_transaction_t * | transact, |
xta_xa_resource_t * | xa_res | ||
) |
Enlist the resource specified with the Transaction associated with the Transaction object
[in,out] | transact | : transaction object |
[in] | xa_res | : resource to associate |
Definition at line 340 of file xta_transaction.c.
References xta_transaction_s::client_status, LIXA_RC_G_TRY_MALLOC_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, xta_transaction_s::local_ccc, xta_transaction_redigest(), xta_xa_resource_enlisted(), xta_xa_resource_get_config(), and xta_xa_resource_is_dynamic().
xta_config_t* xta_transaction_get_config | ( | xta_transaction_t * | transact | ) |
Get a reference to the configuration that applies to this transaction object, like all the define Resource Managers
[in] | transact | : Transaction object |
Definition at line 307 of file xta_transaction.c.
References LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and xta_transaction_s::local_ccc.
int xta_transaction_get_multiple_branches | ( | const xta_transaction_t * | transact | ) |
Get the flag multiple_branches
[in] | transact | : transaction object |
Definition at line 1556 of file xta_transaction.c.
References LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and xta_transaction_s::multiple_branches.
Referenced by xta_transaction_manager_create_transaction().
const xta_xid_t* xta_transaction_get_xid | ( | const xta_transaction_t * | transact | ) |
Get the Xid associated with the Transaction object
[in] | transact | : transaction object |
Definition at line 1523 of file xta_transaction.c.
References LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, and xta_transaction_s::xid.
xta_transaction_t* xta_transaction_new | ( | void | ) |
Create a new Transaction object
Definition at line 54 of file xta_transaction.c.
References LIXA_RC_G_TRY_MALLOC_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_OK, and lixa_strerror().
Referenced by xta_transaction_manager_create_transaction().
int xta_transaction_open | ( | xta_transaction_t * | transact | ) |
Definition at line 553 of file xta_transaction.c.
References xta_transaction_open_internal().
int xta_transaction_open_internal | ( | xta_transaction_t * | transact | ) |
Definition at line 560 of file xta_transaction.c.
References xta_transaction_s::already_opened, xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, xta_transaction_s::local_ccc, and xta_transaction_s::xid.
Referenced by xta_transaction_branch(), xta_transaction_open(), xta_transaction_recover(), xta_transaction_resume(), and xta_transaction_start().
int xta_transaction_recover | ( | xta_transaction_t * | transact | ) |
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 xta_transaction_start, xta_transaction_resume and xta_transaction_branch are called
[in,out] | transact | : transaction object |
Definition at line 709 of file xta_transaction.c.
References LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, xta_transaction_close_internal(), and xta_transaction_open_internal().
int xta_transaction_redigest | ( | xta_transaction_t * | transact, |
const xta_xa_resource_config_t * | xrc | ||
) |
When a resource registers dynamically the digest must be updated because the configuration has been altered. This must be considered a PRIVATE method and should not be used by the Application Program.
[in,out] | transact | : transaction object |
[in] | xrc | : XA resource configuration (LIXA legacy structure) |
Definition at line 451 of file xta_transaction.c.
References xta_transaction_s::client_status, lixa_job_get_raw(), lixa_job_reset(), lixa_job_set_config_digest(), lixa_job_set_source_ip(), LIXA_RC_G_CHECKSUM_GET_STRING_ERROR, LIXA_RC_G_CHECKSUM_NEW_ERROR, LIXA_RC_INTERNAL_ERROR, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, xta_transaction_s::local_ccc, and MD5_DIGEST_LENGTH.
Referenced by xta_transaction_enlist_resource().
int xta_transaction_resume | ( | xta_transaction_t * | transact, |
const char * | xid_string, | ||
long | flags | ||
) |
Resume the transaction represented by xid in this transaction object; the transaction has been previously suspended with xta_transaction_suspend
[in,out] | transact | transaction object |
[in] | xid_string | serialized identifier of the transaction that must be resumed (see xta_xid_to_string) |
[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 1290 of file xta_transaction.c.
References xta_transaction_s::already_opened, xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_OPTION, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, LIXA_RC_PROTOCOL_ERROR, xta_transaction_s::local_ccc, TMJOIN, TMRESUME, xta_transaction_s::xid, xta_transaction_open_internal(), xta_xid_get_xa_xid(), and xta_xid_new_from_string().
int xta_transaction_rollback | ( | xta_transaction_t * | transact | ) |
Rollback the transaction represented by this transaction object
[in,out] | transact | : transaction object |
Definition at line 1092 of file xta_transaction.c.
References xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, LIXA_RC_TX_HAZARD, LIXA_RC_TX_MIXED, xta_transaction_s::local_ccc, TMSUCCESS, xta_transaction_s::xid, xta_xid_get_xa_xid(), and xta_xid_reset().
int xta_transaction_safe_delete | ( | const xta_transaction_t * | transact | ) |
Check if the transaction object can be safely deleted: if there's a transaction in progress, this method returns FALSE
[in] | transact | : transaction object to delete |
Definition at line 244 of file xta_transaction.c.
References xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, and LIXA_RC_OK.
Referenced by xta_transaction_manager_create_transaction().
int xta_transaction_start | ( | xta_transaction_t * | transact, |
int | multiple_branches | ||
) |
Start a new XA Transaction. From the XA specification point of view, it calls xa_start (for the Native XA Resource Managers)
[in,out] | transact | : transaction object |
[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 |
Definition at line 752 of file xta_transaction.c.
References xta_transaction_s::already_opened, xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_STATUS, LIXA_RC_NON_REUSABLE_TX, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, xta_transaction_s::local_ccc, xta_transaction_s::multiple_branches, TMNOFLAGS, xta_transaction_s::xid, xta_transaction_open_internal(), xta_xid_get_xa_xid(), and xta_xid_new().
int xta_transaction_suspend | ( | xta_transaction_t * | transact, |
long | flags | ||
) |
Suspend the transaction represented by this transaction object; the transaction can be resumed with xta_transaction_resume at a later time
[in,out] | transact | : transaction object |
[in] | flags | can be TMMIGRATE if the Resource Manager supports transaction migration and TMNOFLAGS otherwise |
Definition at line 1209 of file xta_transaction.c.
References xta_transaction_s::client_status, LIXA_RC_INTERNAL_ERROR, LIXA_RC_INVALID_OPTION, LIXA_RC_INVALID_STATUS, LIXA_RC_NULL_OBJECT, LIXA_RC_OK, LIXA_RC_PROTOCOL_ERROR, xta_transaction_s::local_ccc, TMMIGRATE, TMNOFLAGS, TMSUSPEND, xta_transaction_s::xid, and xta_xid_get_xa_xid().