![]() |
![]() |
|
|
tx_info(3c)
Name
tx_info() - return global transaction information
Synopsis
#include <tx.h>
int tx_info(TXINFO *info)
Description
tx_info() returns global transaction information in the structure pointed to by info. In addition, this function returns a value indicating whether the caller is currently in transaction mode or not. If info is non-null, then tx_info() populates a TXINFO structure pointed to by info with global transaction information. The TXINFO structure contains the following elements:
XID xid;
COMMIT_RETURN when_return;
TRANSACTION_CONTROL transaction_control;
TRANSACTION_TIMEOUT transaction_timeout;
TRANSACTION_STATE transaction_state;
If tx_info() is called in transaction mode, then xid will be populated with a current transaction branch identifier and transaction_state will contain the state of the current transaction. If the caller is not in transaction mode, xid will be populated with the null XID (see <tx.h> for details). In addition, regardless of whether the caller is in transaction mode, when_return, transaction_control, and transaction_timeout contain the current settings of the commit_return and transaction_control characteristics, and the transaction timeout value in seconds.
The transaction timeout value returned reflects the setting that will be used when the next transaction is started. Thus, it may not reflect the timeout value for the caller's current global transaction since calls made to tx_set_transaction_timeout() after the current transaction was begun may have changed its value.
If info is null, no TXINFO structure is returned.
In a multithreaded application, a thread in the TPINVALIDCONTEXT state is not allowed to issue a call to tx_info().
Return Value
If the caller is in transaction mode, then 1 is returned. If the caller is not in transaction mode, then 0 is returned.
Errors
Under the following conditions, tx_info() fails and returns one of these negative values:
See Also
tx_open(3c), tx_set_commit_return(3c), tx_set_transaction_control(3c), tx_set_transaction_timeout(3c)
Warnings
Within the same global transaction, subsequent calls to tx_info() are guaranteed to provide an XID with the same gtrid component, but not necessarily the same bqual component. Both the X/Open TX interface and the X-Windows system define the type XID. It is not possible to use both X-Windows calls and TX calls in the same file.
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|