PURPOSE

tpabort - routine for aborting current transaction

SYNOPSIS


#include <atmi.h>
int tpabort(long flags)

DESCRIPTION

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.

RETURN VALUES

tpabort() returns -1 on error and sets tperrno to indicate the error condition.

ERRORS

Under the following conditions, tpabort() fails and sets tperrno to:

[TPEINVAL]
flags is not equal to 0. The caller's transaction is not affected.
[TPEHEURISTIC]
Due to a heuristic decision, the work done on behalf of the transaction was partially committed and partially aborted.
[TPEHAZARD]
Due to some failure, the work done on behalf of the transaction can have been heuristically completed.
[TPEPROTO]
tpabort() was called in an improper context (for example, by a participant).
[TPESYSTEM]
A System/T error has occurred. The exact nature of the error is written to a log file.
[TPEOS]
An operating system error has occurred.

NOTICES

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().

SEE ALSO

tpbegin(3c),
tpcommit(3c),
tpgetlev(3c)