tx_begin — Start the global transaction
#include <tx.h>
int tx_begin(void);
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
Function starts global transaction for given thread. The resource managers prior must be open by tx_open(3). The transaction shall be terminated with tx_commit(3) or tx_rollback(3).
When transaction is started, it uses settings applied by following functions:
TX API is base on TP API. This function is based on tpbegin(3) and it is possible to mix these two API kinds.
TX_PROTOCOL_ERROR Function is called in improper context, either there was no call to tx_open() or thread is already is global transaction.
TX_ERROR Error occurred at transaction manager. The exact cause shall be checked in transaction manager log files. At this error, control thread is no more in global transaction.
TX_FAIL System error occurred during starting the transaction. The exact cause shall be checked in current process and/or transaction manager log files. At this error, control thread is no more in global transaction.