ATMI C Function Reference
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()
, 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()
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()
or with the TPNOTRAN
flag (that is, not in transaction mode) are not affected.
Currently, the sole argument to the tpabort()
function, flags
, is reserved for future use and should be set to 0.
In a multithreaded application, a thread in the TPINVALIDCONTEXT
state is not allowed to issue a call to tpabort()
.
Upon failure, tpabort()
returns -1 and sets tperrno
to indicate the error condition.
Upon failure, tpabort()
sets tperrno
to one of the following values:
Due to a heuristic decision, the work done on behalf of the transaction was partially committed and partially aborted.
Due to some failure, the work done on behalf of the transaction could have been heuristically completed.
When using tpbegin()
, tpcommit()
, and tpabort()
to delineate a BEA Tuxedo ATMI system 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()
or tpabort()
.