gtpg2m54 | General Macros |
This general macro continues a transaction that was suspended by the entry control block (ECB) of the caller.
Format
|
Entry Requirements
This macro is restricted to ECB-controlled programs. Register 9 (R9) has to be the base of a valid ECB and must be executing in the ECB virtual memory (EVM).
Return Conditions
Programming Considerations
Examples
The following example shows some of the ways that the TXSPC macro (suspend a global transaction) and the TXRSC macro (resume a global transaction) can be used in either root transaction or nested transaction scenarios. The comments to the right of the example code describe which transactions are active and what value is contained in the suspend counter throughout the example.
Transaction 1 is a root transaction that is suspended using the TXSPC macro before beginning transaction 2 (another root transaction). Transaction 2 is then suspended twice and resumed twice. After the transaction has continued (TXRSC) for the second time, the suspend counter is zero so transaction 2 becomes active again. Transaction 2 continues processing and is eventually committed (TXCMC). Transaction 1 remains suspended until it is explicitly resumed by the next TXRSC macro.
Transaction 3 then begins as a nested transaction under transaction 1. The transaction manager (TM) calls the TXSPC macro to suspend both transaction 3 and transaction 1.
Later, the TM calls the TXRSC macro to continue the transactions. Eventually, the TM calls the TXCMC macro to commit first the nested and then the root transactions.
TXBGC /* begin transaction 1, root */ . TXSPC /* suspend transaction 1, */ . /* suspend counter = 1. */ . TXBGC /* begin transaction 2, root */ . /* not a nested transaction */ . /* transaction 2 is now active */ . TXSPC /* suspend transaction 2 */ . /* suspend counter = 1. */ . TXSPC /* suspend transaction 2 again */ . /* suspend counter = 2. */ . TXRSC /* resume transaction 2 */ . /* suspend counter = 1. */ . /* transaction is still suspended*/ . TXRSC /* resume transaction 2 */ . /* suspend counter = 0. */ . /* transaction 2 is now active */ . TXCMC /* commit transaction 2 */ . . /* transaction 1 is suspended */ . /* suspend counter is 1. */ . TXRSC /* transaction 1 is now active */ . /* suspend counter is 0. */ . TXBGC /* begin transaction 3, nested */ . . TXSPC /* suspend transaction 3 and 1 */ . /* suspend counter is 1. */ . TXRSC /* resume transaction 3 and 1 */ . /* suspend counter is 0. */ . /* transaction 3 is now active */ . TXCMC /* commit transaction 3 */ . /* transaction 1 is now active */ . TXCMC /* commit transaction 1 */