tpabort - routine for aborting current transaction
#include <atmi.h> int tpabort(long flags)
tpabort() signifies the abnormal end of a transaction. When this call returns, all changes made to resources during the transaction are undone. Like tpcommit(3c), this function can be called only by the initiator of a transaction. Participants (that is, service routines) can express their desire to have a transaction aborted by calling tpreturn(3c) with TPFAIL.
If tpabort() is called while call descriptors exist for outstanding replies, then upon return from the function, the transaction is aborted and those descriptors associated with the caller's transaction are no longer valid. Call descriptors not associated with the caller's transaction remain valid.
For each open connection to a conversational server in transaction mode, tpabort() will send a TPEV_DISCONIMM event to the server, whether or not the server has control of a connection. Connections opened before tpbegin(3c) or with the TPNOTRAN flag (that is, not in transaction mode) are not affected.
Currently, tpabort()'s sole argument, flags, is reserved for future use and should be set to 0.
tpabort() returns -1 on error and sets tperrno to indicate the error condition.
Under the following conditions, tpabort() fails and sets tperrno to:
When using tpbegin(3c), tpcommit(3c) and tpabort() to delineate a System/T transaction, it is important to remember that only the work done by a resource manager that meets the XA interface (and is linked to the caller appropriately) has transactional properties. All other operations performed in a transaction are not affected by either tpcommit(3c) or tpabort().