0001 TX_SET_TRANSACTION_CONTROL(3)
0002 =============================
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 tx_set_transaction_control - Set how to behave at tx_commit() or tx_rollback()
0009
0010
0011 SYNOPSIS
0012 --------
0013 #include <tx.h>
0014
0015 int tx_set_transaction_control(TRANSACTION_CONTROL control);
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 Change the logic of how *tx_commit(3)* or *tx_rollback(3)* shall behave.
0024
0025 Setting affects current transaction and is used during the phase when commit
0026 or abort is performed. The setting value is stored in thread local stored for
0027 particular control thread.
0028
0029 Parameter 'control' accepts following values:
0030
0031 - *TX_UNCHAINED* this is *default* value. Meaning that when commit or rollback has
0032 been performed, the current control thread will not be in transaction, i.e.
0033 thread have left any global transaction.
0034
0035 - *TX_CHAINED* means that when transaction is committed or rolled back, a new
0036 transaction is started. The start of new transaction is performed only those
0037 cases when there is proper context for it. For example is commit or abort
0038 encouraged protocol error, the new transaction is not started. The commit/rollback
0039 error and new transaction state is returned combined error code. If error is
0040 received during starting next transaction, the error code is corrected (summed)
0041 with *TX_NO_BEGIN* error code.
0042
0043
0044 RETURN VALUE
0045 ------------
0046 On success, *tx_set_transaction_control()* return *TX_OK*; on error, error code is returned
0047
0048 ERRORS
0049 ------
0050
0051 *TX_EINVAL* The value of 'when_return' is not *TX_UNCHAINED* nor
0052 *TX_CHAINED*.
0053
0054 *TX_PROTOCOL_ERROR* Transaction manager is not open by *tx_open(3)*
0055
0056 EXAMPLE
0057 -------
0058 See *atmitest/test021_xafull/atmiclt21tx.c* for sample code.
0059
0060 BUGS
0061 ----
0062 Report bugs to support@mavimax.com
0063
0064 SEE ALSO
0065 --------
0066 *tx_open(3)* *tx_close(3)* *tx_begin(3)* *tx_commit(3)* *tx_rollback(3)* *tx_info(3)*
0067 *tx_set_transaction_timeout(3)* *tx_set_commit_return(3)*
0068
0069 COPYING
0070 -------
0071 (C) Mavimax, Ltd
0072