ATMI C Function Reference
tx_set_commit_return()
—Sets the commit_return
characteristic.
#include <tx.h>
int tx_set_commit_return(COMMIT_RETURN when_return)
tx_set_commit_return()
sets the commit_return
characteristic to the value specified in when_return
. This characteristic affects the way tx_commit()
behaves with respect to returning control to its caller. tx_set_commit_return()
may be called regardless of whether its caller is in transaction mode. This setting remains in effect until changed by a subsequent call to tx_set_commit_return()
.
The initial setting for this characteristic is TX_COMMIT_COMPLETED
.
The following are the valid settings for when_return
:
This flag indicates that tx_commit()
should return after the commit decision has been logged by the first phase of the two-phase commit protocol but before the second phase has completed. This setting allows for faster response to the caller of tx_commit()
. However, there is a risk that a transaction will have a heuristic outcome, in which case the caller will not find out about this situation via return codes from tx_commit()
. Under normal conditions, participants that promise to commit during the first phase will do so during the second phase. In certain unusual circumstances however (for example, long-lasting network or node failures), phase 2 completion may not be possible and heuristic results may occur.
In a multithreaded application, a thread in the TPINVALIDCONTEXT
state is not allowed to issue a call to tx_set_commit_return()
.
Upon successful completion, tx_set_commit_return()
returns TX_OK
, a non-negative return value.
Under the following conditions, tx_set_commit_return()
does not change the setting of the commit_return
characteristic and returns one of these negative values:
The function was called in an improper context (for example, the caller has not yet called tx_open()
).
tx_commit(3c)
, tx_info(3c)
, tx_open(3c)
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.