0001 TX_ROLLBACK(3)
0002 ==============
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 tx_rollback - Rollback a global transaction
0009
0010
0011 SYNOPSIS
0012 --------
0013 #include <tx.h>
0014
0015 int tx_rollback(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 rolls back global transaction associated with current thread
0024 previously started by *tx_begin(3)*. If transaction control was changed by
0025 *tx_set_transaction_control(3)* flag *TX_CHAINED*, the new transaction is started
0026 immediately after the rollback.
0027
0028 Function use following attributes set by:
0029
0030 - *tx_set_transaction_control(3)* - if applied with *TX_CHAINED*, new transaction
0031 is started. The default is *TX_UNCHAINED* - meaning after rollback, control thread
0032 is no more in global transaction.
0033
0034 TX API is base on TP API. This function is based on *tpabort(3)* and it is possible
0035 to mix these two API kinds.
0036
0037 In case if process is joined to the transaction (i.e. it is not an initiator
0038 of the transaction) and tx_rollback() is called, the error *TX_PROTOCOL_ERROR* is returned,
0039 process keeps participation in the transaction.
0040
0041 RETURN VALUE
0042 ------------
0043 On success, *tx_rollback()* return *TX_OK*; on error, error code is returned
0044
0045 ERRORS
0046 ------
0047
0048 *TX_NO_BEGIN* The transaction committed successfully; however, a new
0049 transaction could not be started and the caller is no longer in transaction mode.
0050 This return value occurs only when the transaction_control characteristic is *TX_CHAINED*.
0051
0052 *TX_MIXED* The transaction was partially committed and partially rolled back.
0053 In addition, if the *transaction_control(3)* characteristic is *TX_CHAINED*,
0054 a new transaction is started.
0055
0056 *TX_MIXED_NO_BEGIN* The transaction was partially committed and partially
0057 rolled back. In addition, a new transaction could not be started and the caller
0058 is no longer in transaction mode. This return value can occur only when the
0059 *transaction_control(3)* characteristic is *TX_CHAINED*.
0060
0061 *TX_HAZARD* Due to a failure, the transaction may have been partially
0062 committed and partially rolled back. In addition, if the *transaction_control(3)*
0063 characteristic is *TX_CHAINED*, a new transaction is started.
0064
0065 *TX_HAZARD_NO_BEGIN* Due to a failure, the transaction may have been partially
0066 committed and partially rolled back. In addition, a new transaction could
0067 not be started and the caller is no longer in transaction mode. This return
0068 value can occur only when the *transaction_control(3)* characteristic
0069 is *TX_CHAINED*.
0070
0071 *TX_PROTOCOL_ERROR* The function was called in an improper context
0072 (for example, the caller is not in transaction mode). The caller’s state
0073 with respect to the transaction is not changed.
0074
0075 *TX_FAIL* Either the transaction manager or one or more of the
0076 resource managers encountered a fatal error. The nature of the error is
0077 such that the transaction manager and/or one or more of the resource managers
0078 can no longer perform work on behalf of the application. The exact
0079 nature of the error is determined in a product-specific manner. The caller’s
0080 state with respect to the transaction is unknown.
0081
0082 EXAMPLE
0083 -------
0084 See *atmitest/test021_xafull/atmiclt21tx.c* for sample code.
0085
0086 BUGS
0087 ----
0088 Report bugs to support@mavimax.com
0089
0090 SEE ALSO
0091 --------
0092 *tx_begin(3)* *tpabort(3)* *tx_commit(3)* *tx_info(3)* *tx_close(3)*
0093 *tx_set_transaction_timeout(3)* *tx_set_transaction_control(3)*
0094 *tx_set_commit_return(3)*
0095
0096 COPYING
0097 -------
0098 (C) Mavimax, Ltd
0099