OpenTP1 Version 7 Programming Reference C Language
tx_set_transaction_control - Set transaction_control characteristic
Format
ANSI C, C++
#include <tx.h> int tx_set_transaction_control (TRANSACTION_CONTROL control) |
K&R C
#include <tx.h> int tx_set_transaction_control (control) TRANSACTION_CONTROL control |
Description
The function 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.
The function 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.
<<Argument>>
<<control>>
The valid settings for control are as follows:
{TX_UNCHAINED|TX_CHAINED}
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.
Return value | Return value (numeric) | Explanation |
---|---|---|
TX_EINVAL | -8 | The value set for control is neither TX_UNCHAINED nor TX_UNCHAINED. |
TX_PROTOCOL_ERROR | -5 | The function was called in an improper context (for example, the caller has not yet called tx_open()). |
TX_FAIL | -7 | 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. |
See also
tx_begin(), tx_commit(), tx_open(), tx_rollback(), tx_info().
<<Example>>
<<if (tx_set_transaction_return (TX_UNCHAINED) == 0 && tx_commit() < 0 ) fputs ("cannot commit transaction\n", stderr);>> |
<<Note on use with OpenTP1>>
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.