tx_info — Return transaction information
#include <tx.h>
int tx_info(TXINFO *info);
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 returns current transaction status information. This includes current control settings, timeout active XID. Information is returned in following structure
struct tx_info_t { XID xid; COMMIT_RETURN when_return; TRANSACTION_CONTROL transaction_control; TRANSACTION_TIMEOUT transaction_timeout; TRANSACTION_STATE transaction_state; }; typedef struct tx_info_t TXINFO;
Field xid is returned only in case if there is active transaction. If there is no transaction, then empty xid is returned (xid.formatID set to -1).
transaction_state may contain following values:
Field when_return returns either TX_COMMIT_COMPLETED or TX_COMMIT_DECISION_LOGGED, set by tx_set_commit_return(3).
Field transaction_control returns either TX_UNCHAINED or TX_CHAINED set by tx_set_transaction_control(3).
Field transaction_timeout returns current timeout setting in seconds applied by tx_set_transaction_timeout(3).
On success, and if there is transaction started, then tx_info() return 1, if there is no local transaction, 0 is returned. Nn error, error code is returned.
TX_PROTOCOL_ERROR The function was called in an improper context (for example, the caller has not yet called tx_open(3)).
TX_FAIL Transaction manager (tmsrv(8)) failed to return transaction information. For exact information, see either process and/or transaction manager logs