[Top] [Prev] [Next] [Bottom]

TPSUSPEND(3CBL)

TPSUSPEND(3CBL)

Name

TPSUSPEND-suspend a global transaction

synopsis

01 TPTRXDEF-REC.
COPY TPTRXDEF.

01 TPSTATUS-REC.
COPY TPSTATUS.

CALL "TPSUSPEND" USING TPTRXDEF-REC TPSTATUS-REC.

Description

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].

Errors

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

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

[TPEPROTO]
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.

[TPESYSTEM]
A BEA TUXEDO system error has occurred. The exact nature of the error is written to a log file.

[TPEOS]
An operating system error has occurred.

See Also

TPACALL(), TPBEGIN(), TPRECV(), TPRESUME().



[Top] [Prev] [Next] [Bottom]