User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:api:xatmi:tpsuspend.3

tpsuspend

Name

tpsuspend — Suspend global transaction, and disassociate current thread from XA transaction

Synopsis

#include <atmi.h>

int tpsuspend (TPTRANID *tranid, long flags);

For XATMI client link with -latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm

For XATMI server link with -latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm

DESCRIPTION

Disassociate XA transaction from current thread and store transaction details to tranid variable. The transaction can be resumed as by doing tpresume(3). tranid must not be NULL. flags are reserved for future use, and currently must be set to 0. It is error to have any open call descriptors (either by tpacall(3) or by tpconnect(3)). Suspending can be done by any involved process in transaction. But the role of participant does not change. The TPTRANID type records the information about caller, is it transaction originator or not.

If transaction was suspended, it must be resumed afterwards with tpresume(3), otherwise XA resources may rejected the underlying xa_prepare() call with protocol error, which would lead to the fact that commit will be aborted, and tpcommit(3) would return TPEABORT error.

Valid flags

TPTXNOOPTIM Do not use cached known resource managers in tranid. Thus having this flag set, this process even for previously involved RMs will perform xa transaction start and if that fails, then attempt TM_JOIN.

TPTXTMSUSPEND Transaction shall be suspended with TMSUSPEND flag instead of TMSUCCESS. If this flag is used, then tranid shall not be used in other thread/process that this particular which performed suspend. The benefit for this flag is that certain XA resources might allow to resume operations on cursors, etc. . This applies to XA switches which support join operation and join is not disabled by NOJOIN flag in NDRX_XA_FLAGS.

RETURN VALUE

On success, tpsuspend() return zero; on error, -1 is returned, with tperrno set to indicate the error.

ERRORS

Note that tpstrerror() returns generic error message plus custom message with debug info from last function call.

TPEINVAL flags was not 0. Or tranid was NULL.

TPEPROTO XA subsystem was not initialized (did not call tpopen()), global transaction was not already started, or there was open call descriptors.

TPESYSTEM System failure occurred during serving. See logs i.e. user log, or debugs for more info.

TPEOS System failure occurred during serving. See logs i.e. user log, or debugs for more info.

EXAMPLE

See atmitest/test021_xafull/atmiclt21-cli.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd