User Tools

Site Tools


Sidebar

Table Of Contents

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

tpabort

Name

tpabort — Abort the global transaction in progress

Synopsis

#include <atmi.h>

int tpabort (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

Abort the global transaction. This will make any resources touched during the transaction to roll back. Enduro/X will make all resource managers to rollback the changes. Abort of transaction can only be done by transaction initiator, who originally did tpbegin(). flags is reserved for future use and must be 0.

tpabort() is allowed for autotran started transactions for configured service or in service to which autotran stared transaction call was forwarded. After executing abort server process normally will leave a transaction.

In case if process is joined to the transaction (i.e. it is not an initiator of the transaction) and tpabort() is called, the error TPEPROTO is returned, process keeps participation in the transaction.

After the call process leaves the global transaction if one is in the progress, except if noted otherwise in the error description.

RETURN VALUE

On success, tpabort() 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. The caller’s state with respect to the transaction is not changed.

TPETIME Transaction manager (tmsrv(8)) did not respond in configured time-out time. The state of transaction is unknown.

TPEHAZARD The state of transaction is not fully know. It can be that it is partially committed and partially aborted.

TPEHEURISTIC The state of transaction is not full known. The transaction heuristically completed.

TPESVCERR Failed to call transaction manager, with service error. The state of transaction is unknown.

TPEPROTO XA subsystem was not initialized (did not call tpopen()), no global transaction started or caller is not initiator of transaction. The caller’s state with respect to the transaction is not changed.

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.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd