User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.0.x:api:xatmi:tpcommit.3

TPCOMMIT

TPCOMMIT

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
EXAMPLE
BUGS
SEE ALSO
COPYING

NAME

tpcommit − Commit global transaction in progress

SYNOPSIS

#include <atmi.h>

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

Function does commit the global transaction. Transaction must not be marked as abort only (e.g. in case if tpcall() failed). After issuing the command, tmsrv(8) will do the commit procedure, prepare phase first, log the results of prepare to persistent storage, and then do the actual commit. The commit control value value is set either by tpscmt(3) or tx_set_commit_return(3) additionally it can be overriden by the TPTXCOMMITDLOG flag.

By default tpcommit performs full commit.

Valid flags

TPTXCOMMITDLOG If set, tpcommit will return when decision for commit is logged (i.e. first phase of 2 phase commit is done − resource managers are in prepared state). Thus transaction will be completed by tmsrv background thread, which runs periodically by −s (command line argument) seconds.

RETURN VALUE

On success, tpcommit() 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 was not TPTXCOMMITDLOG.

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

TPEABORT Global transaction was marked for abort and was aborted, or prepare state failed for some of the resource managers and transaction was aborted.

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.

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

SEE ALSO

tpbegin(3) tpabort(3) tpopen(3) tpscmt(3)

COPYING

© Mavimax, Ltd