Back to home page

Enduro/X

 
 

    


0001 TX_INFO(3)
0002 ============
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tx_info - Return transaction information
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <tx.h>
0014 
0015 int tx_info(TXINFO *info);
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 returns current transaction status information. This includes current
0024 control settings, timeout active XID. Information is returned in following
0025 structure
0026 
0027 --------------------------------------------------------------------------------
0028 
0029 struct tx_info_t {
0030     XID xid;
0031     COMMIT_RETURN when_return;
0032     TRANSACTION_CONTROL transaction_control;
0033     TRANSACTION_TIMEOUT transaction_timeout;
0034     TRANSACTION_STATE transaction_state;
0035 };
0036 typedef struct tx_info_t TXINFO;
0037 
0038 --------------------------------------------------------------------------------
0039 
0040 Field 'xid' is returned only in case if there is active transaction. If there
0041 is no transaction, then empty *xid* is returned (xid.formatID set to -1).
0042 
0043 'transaction_state' may contain following values:
0044 
0045 - *TX_ACTIVE* transaction is active.
0046 
0047 - *TX_TIMEOUT_ROLLBACK_ONLY* transaction for current control thread is active,
0048 but transaction manager is not aware of transaction, thus it is assumed that
0049 there was timeout and transaction was rolled back.
0050 
0051 -  *TX_ROLLBACK_ONLY* transaction in current control thread is marked as rollback
0052 only.
0053 
0054 Field 'when_return' returns either *TX_COMMIT_COMPLETED* or *TX_COMMIT_DECISION_LOGGED*,
0055 set by *tx_set_commit_return(3)*.
0056 
0057 Field 'transaction_control' returns either *TX_UNCHAINED* or *TX_CHAINED* set by
0058 *tx_set_transaction_control(3)*.
0059 
0060 Field 'transaction_timeout' returns current timeout setting in seconds applied by
0061 *tx_set_transaction_timeout(3)*.
0062 
0063 
0064 RETURN VALUE
0065 ------------
0066 On success, and if there is transaction started, then *tx_info()* return *1*,
0067 if there is no local transaction, *0* is returned. Nn error, error code is returned.
0068 
0069 ERRORS
0070 ------
0071 
0072 *TX_PROTOCOL_ERROR* The function was called in an improper context 
0073 (for example, the caller has not yet called tx_open(3)).
0074 
0075 *TX_FAIL* Transaction manager (*tmsrv(8)*) failed to return transaction information.
0076 For exact information, see either process and/or transaction manager logs
0077 
0078 EXAMPLE
0079 -------
0080 See *atmitest/test021_xafull/atmiclt21tx.c* for sample code.
0081 
0082 BUGS
0083 ----
0084 Report bugs to support@mavimax.com
0085 
0086 SEE ALSO
0087 --------
0088 *tx_begin(3)* *tpcommit(3)* *tx_rollback(3)* *tx_info(3)* *tx_close(3)*
0089 *tx_set_transaction_timeout(3)* *tx_set_transaction_control(3)*
0090 *tx_set_commit_return(3)*
0091 
0092 COPYING
0093 -------
0094 (C) Mavimax, Ltd
0095