7.5 Ending a Conversation
A connection can be taken down gracefully and a conversation ended normally through:
- A successful call to tpreturn() in a simple conversation.
- A series of successful calls to
tpreturn()
in a complex conversation based on a hierarchy of connections. - Global transactions, as described in Writing Global Transactions.
- The
tpreturn()
function is described in detail in Writing Request/Response Clients and Servers.
The following sections describe two scenarios for gracefully terminating conversations that do not include global transactions in which the tpreturn()
function is used.
The first example shows how to terminate a simple conversation between two components. The second example illustrates a more complex scenario, with a hierarchical set of conversations.
If you end a conversation with connections still open, the system returns an error. In this case, either tpcommit()
or tpreturn()
fails in a disorderly manner.