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_close(3c)

Name

tx_close()—Closes a set of resource managers.

Synopsis

#include <tx.h> 
int tx_close(void)

Description

tx_close() closes a set of resource managers in a portable manner. It invokes a transaction manager to read resource-manager-specific information in a transaction-manager-specific manner and pass this information to the resource managers linked to the caller.

tx_close() closes all resource managers to which the caller is linked. This function is used in place of resource-manager-specific "close" calls and allows an application program to be free of calls which may hinder portability. Since resource managers differ in their termination semantics, the specific information needed to "close" a particular resource manager must be published by each resource manager.

tx_close() should be called when an application thread of control no longer wishes to participate in global transactions. tx_close() fails (returning [TX_PROTOCOL_ERROR]) if the caller is in transaction mode. That is, no resource managers are closed even though some may not be participating in the current transaction.

When tx_close() returns success (TX_OK), all resource managers linked to the calling thread are closed.

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

Return Value

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

Errors

Under the following conditions, tx_close() fails and returns one of these negative values:

[TX_PROTOCOL_ERROR]

The function was called in an improper context (for example, the caller is in transaction mode). No resource managers are closed.

[TX_ERROR]

Either the transaction manager or one or more of the resource managers encountered a transient error. The exact nature of the error is written to a log file. All resource managers that could be closed are closed.

[TX_FAIL]

Either the transaction manager or one or more of the resource managers encountered a fatal error. The nature of the error is such that the transaction manager and/or one or more of the resource managers 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_open(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