tx_set_commit_return-set 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(3) 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.
Following are the valid settings for when_return.
TX_COMMIT_DECISION_LOGGED
tx_commit(3) 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(3). 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(3). 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.
TX_COMMIT_COMPLETED
tx_commit(3) should return after the two-phase commit protocol has finished completely. This setting allows the caller of tx_commit(3) to see return codes that indicate that a transaction had or may have had heuristic results.
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:
TX_EINVAL]
when_return is not one of TX_COMMIT_DECISION_LOGGED or TX_COMMIT_COMPLETED.
TX_PROTOCOL_ERROR]
tx_open(3)).
TX_FAIL]
tx_commit(3), tx_open(3), tx_info(3)
Both the X/Open TX interface and the X-Windows system defines the type XID. It is not possible to use both X-Windows calls and TX calls in the same file.