BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo C Function Reference

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:

[TX_PROTOCOL_ERROR]

The function was called in an improper context (for example, the caller has not yet called tx_open()).

[TX_FAIL]

The transaction manager encountered a fatal error. The nature of the error is such that the transaction manager can no longer perform work on behalf of the application. The exact nature of the error is written to a log file.

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.