BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy


   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo COBOL Function Reference



TPSUSPEND() - suspend a global transaction






TPSUSPEND() is used to suspend the transaction active in the caller's program. A transaction begun with TPBEGIN() may be suspended with TPSUSPEND(). Either the suspending program or another program may use TPRESUME() to resume work on a suspended transaction. When TPSUSPEND() returns, the caller is no longer in transaction mode. However, while a transaction is suspended, all resources associated with that transaction (such as database locks) remain active. Like an active transaction, a suspended transaction is susceptible to the transaction timeout value that was assigned when the transaction first began.

For the transaction to be resumed in another process, the caller of TPSUSPEND() must have been the initiator of the transaction by explicitly calling TPBEGIN(). TPSUSPEND() may also be called by a process other than the originator of the transaction (for example, a server that receives a request in transaction mode). In the latter case, only the caller of TPSUSPEND() may call TPRESUME() to resume that transaction. This case is allowed so that a process can temporarily suspend a transaction to begin and do some work in another transaction before completing the original transaction (for example, to run a transaction to log a failure before rolling back the original transaction).

TPSUSPEND() populates TRANID with the transaction identifier being suspended.

To ensure success, the caller must have completed all outstanding transactional communication with servers before issuing TPSUSPEND(). That is, the caller must have received all replies for requests sent with TPACALL() that were associated with the caller's transaction. Also, the caller must have closed all connections with conversational services associated with the caller's transaction (that is, TPRECV() must have returned the TPEV-SVCSUCC event). If either rule is not followed, then TPSUSPEND() fails, the caller's current transaction is not suspended and all transactional communication handles remain valid. Communication handles not associated with the caller's transaction remain valid regardless of the outcome of TPSUSPEND().

Return Value

Upon successful completion, TPSUSPEND() sets [TPOK].


Under the following conditions, TPSUSPEND() fails and sets TP-STATUS to:


The caller's active transaction has been aborted. All communication handles associated with the transaction are no longer valid.


TPSUSPEND() was called in an improper context (for example, the caller is not in transaction mode). The caller's state with respect to transaction mode is unchanged.


A BEA Tuxedo system error has occurred. The exact nature of the error is written to a log file.


An operating system error has occurred.

See Also

TPACALL(3cbl), TPBEGIN(3cbl), TPRECV(3cbl), TPRESUME(3cbl)