![]() |
![]() |
|
|
tx_begin(3c)
Name
tx_begin()—Begins a global transaction.
Synopsis
#include <tx.h>
int tx_begin(void)
Description
tx_begin() is used to place the calling thread of control in transaction mode. The calling thread must first ensure that its linked resource managers have been opened (via tx_open()) before it can start transactions. tx_begin() fails (returning [TX_PROTOCOL_ERROR]) if the caller is already in transaction mode or tx_open() has not been called.
Once in transaction mode, the calling thread must call tx_commit() or tx_rollback() to complete its current transaction. There are certain cases related to transaction chaining where tx_begin() does not need to be called explicitly to start a transaction. See tx_commit() and tx_rollback() for details.
In a multithreaded application, a thread in the TPINVALIDCONTEXT state is not allowed to issue a call to tx_begin().
Optional Set-up
tx_set_transaction_timeout()
Return Value
Upon successful completion, tx_begin() returns TX_OK, a non-negative return value.
Errors
Under the following conditions, tx_begin() fails and returns one of these negative values:
See Also
tx_commit(3c), tx_open(3c), tx_rollback(3c), tx_set_transaction_timeout(3c)
Warnings
XA-compliant resource managers must be successfully opened to be included in the global transaction. (See tx_open(3c) for details.) 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.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|