Back to home page

Enduro/X

 
 

    


0001 TX_BEGIN(3)
0002 ===========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tx_begin - Start the global transaction
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <tx.h>
0014 
0015 int tx_begin(void);
0016 
0017 For XATMI client link with '-latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm'
0018 
0019 For XATMI server link with '-latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm'
0020 
0021 DESCRIPTION
0022 -----------
0023 Function starts global transaction for given thread. The resource managers prior
0024 must be open by tx_open(3). The transaction shall be terminated with tx_commit(3)
0025 or tx_rollback(3).
0026 
0027 When transaction is started, it uses settings applied by following functions:
0028 
0029 - tx_set_transaction_timeout(3) - transaction timeout, applied is on per thread bases,
0030 default is *0* - maximum timeout.
0031 
0032 TX API is base on TP API. This function is based on *tpbegin(3)* and it is possible
0033 to mix these two API kinds.
0034 
0035 RETURN VALUE
0036 ------------
0037 On success, *tx_begin()* return *TX_OK*; on error, error code is returned
0038 
0039 
0040 ERRORS
0041 ------
0042 
0043 *TX_PROTOCOL_ERROR* Function is called in improper context, either there was
0044 no call to 'tx_open()' or thread is already is global transaction.
0045 
0046 *TX_ERROR* Error occurred at transaction manager. The exact cause shall be checked
0047 in transaction manager log files. At this error, control thread is no more in
0048 global transaction.
0049 
0050 *TX_FAIL* System error occurred during starting the transaction. The exact cause
0051 shall be checked in current process and/or transaction manager log files. At this
0052 error, control thread is no more in global transaction.
0053 
0054 EXAMPLE
0055 -------
0056 See *atmitest/test021_xafull/atmiclt21tx.c* for sample code.
0057 
0058 BUGS
0059 ----
0060 Report bugs to support@mavimax.com
0061 
0062 SEE ALSO
0063 --------
0064 *tx_open(3)* *tpbegin(3)* *tx_commit(3)* *tx_rollback(3)* *tx_info(3)* *tx_close(3)*
0065 *tx_set_transaction_timeout(3)*
0066 
0067 COPYING
0068 -------
0069 (C) Mavimax, Ltd
0070