tpgetlev - routine for checking if a transaction is in progress
#include <atmi.h> int tpgetlev()
tpgetlev() returns to the caller the current transaction level. Currently, the only levels defined are 0 and 1.
Upon successful completion, tpgetlev() returns either a 0 to indicate that no transaction is in progress, or 1 to indicate that a transaction is in progress; otherwise, tpgetlev() returns -1 on error and sets tperrno to indicate the error condition.
Under the following conditions, tpgetlev() fails and sets tperrno to:
When using tpbegin(3c), tpcommit(3c) and tpabort(3c) 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(3c). See buildserver(1) for details on linking resource managers that meet the XA interface into a server such that operations performed by that resource manager are part of a System/T transaction.