Skip navigation.

ATMI C Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


tx_set_transaction_control(3c)

Name

tx_set_transaction_control()—Sets the transaction_control characteristic.

Synopsis

#include <tx.h> 
int tx_set_transaction_control(TRANSACTION_CONTROL control)

Description

tx_set_transaction_control() sets the transaction_control characteristic to the value specified in control. This characteristic determines whether tx_commit() and tx_rollback() start a new transaction before returning to their caller. tx_set_transaction_control() may be called regardless of whether the application program is in transaction mode. This setting remains in effect until changed by a subsequent call to tx_set_transaction_control().

The initial setting for this characteristic is TX_UNCHAINED.

The following are the valid settings for control:

TX_UNCHAINED

This flag indicates that tx_commit() and tx_rollback() should not start a new transaction before returning to their caller. The caller must issue tx_begin() to start a new transaction.

TX_CHAINED

This flag indicates that tx_commit() and tx_rollback() should start a new transaction before returning to their caller.

In a multithreaded application, a thread in the TPINVALIDCONTEXT state is not allowed to issue a call to tx_set_transaction_control().

Return Value

Upon successful completion, tx_set_transaction_control() returns TX_OK, a non-negative return value.

Errors

Under the following conditions, tx_set_transaction_control() does not change the setting of the transaction_control characteristic and returns one of these negative values:

[TX_EINVAL]

control is not one of TX_UNCHAINED or TX_CHAINED.

[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_begin(3c), tx_commit(3c), tx_info(3c), tx_open(3c), tx_rollback(3c)

Warnings

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.

 

Skip navigation bar  Back to Top Previous Next