gtpc2ma0 | C/C++ Language Support User's Guide |
The transaction manager (TM) calls the xa_start function to
inform a resource manager (RM) that an application may do work for a
transaction branch.
The tx_resume_tpf function must be entered from the entry
control block (ECB) that suspended the transaction branch.
Format
#include (i$tmcr.h)
int xa_start(XID *xid, int rmid, long flags);
- xid
- A pointer to an exchange identification (XID) structure.
xid is a unique identifier assigned by the TM for each transaction
branch.
- rmid
- An integer, assigned by the TM, that can be used to uniquely identify the
called resource manager instance.
- flags
-
- TMRESUME
- Used by the tx_resume_tpf function.
- TMNOFLAGS
- Used by the tx_begin function.
Normal Return
- XA_OK
- xa_start normal completion.
Error Return
- XAER_RMERR
- An error occurred when associating the transaction branch with the thread
of control.
- XAER_RMFAIL
- An error occurred that makes the resource manager unavailable.
- XAER_DUPID
- The XID already exists in the resource manager and the TMRESUME flag is
not set.
- XAER_OUTSIDE
- The resource manager is doing work outside any global transaction for the
application.
- XAER_NOTA
- The TMRESUME flag is set and the specified xid is not known by
the resource manager.
- XAER_INVAL
- Incorrect arguments were specified.
- XAER_PROTO
- The routine was called incorrectly.
- XAER_RBROLLBACK
- A resource manager has not associated the transaction branch with the
thread of control and has marked the transaction branch rollback-only.
Programming Considerations
- You must have authorization to issue a restricted C function.
- From the perspective of the resource manager, the pointer xid
is valid only for the duration of the call to the xa_start()
function;. that is, once the function ends, the transaction
manager is permitted to invalidate where xid points.
Resource managers are encouraged to use private copies of
*xid after the function ends.
Examples
#include (i$tmcr.h)
if (xa_start(XID *xid, int rmid, long flags) != XA_OK)
{
/* handle error condition */
·
·
·
}
else {
/* continue with normal processing */
·
·
·
}
Related Information