IFBOUT (HLI function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (ELowell moved page HLI: IFBOUT call to IFBOUT (HLI function call): better searchability; consistency with existing topic names)
m (Admin moved page IFBOUT (HLI function call) to IFBOUT (HLI function): remove "function call" terminology; keep "function")
(No difference)

Revision as of 00:16, 4 May 2016

Function

The IFBOUT call (BACK OUT) backs out an incomplete transaction on the thread or threads that are active for the transaction in which the thread participates.

Thread type

multiple cursor IFSTRT, single cursor IFSTRT

Syntax

Full syntax (71)

IFBOUT(RETCODE)

Compile-only syntax

A compile-only form of IFBOUT is not available.

Execute-only syntax

An execute-only form of IFBOUT is not available.

Parameters

Parameter Description
RETCODE [O,i,r] The Model 204 return code is the required output parameter. The code is a binary integer value.

Notes and tips

Use the IFBOUT call to activate the Model 204 backout mechanism. The backout function is valid only for transaction backout (TBO) files.

You can issue the IFBOUT call on the following IFSTRT threads:

  • In IFAM2/IFAM4, a single cursor IFSTRT thread with update privileges or a multiple cursor IFSTRT thread.

    Note: You cannot issue IFBOUT on a single cursor IFSTRT thread with read-only privileges, that is, with a thread type indicator of 0.

  • In IFAM1, a single cursor or multiple cursor IFSTRT thread.

    Note: Only the thread, or threads, that participate in the current transaction are backed out. Any IFAM1 type IFSTRT thread involves a single-threaded transaction.

Single cursor IFSTRT threads that are started in a multithreaded IFAM2 or IFAM4 HLI job participate in a multithreaded transaction. See HLI: Transaction processing and recovery for more information about transaction processing in an HLI job.

Completion return code (RETCODE)

IFBOUT is not valid on a read-only type thread, that is, any thread that is started by IFSTRT with an update indicator of 0 for an IFAM2 / IFAM4 connection.

If the IFBOUT call is unsuccessful, Model 204 returns the following error completion codes:

Code Error condition
4 IFBOUT called for a non-transaction backout (non-TBO) file or for a read-only thread.
40 IFBOUT call is encountered on a single cursor IFSTRT thread having read-only privileges.

Record locking behavior

IFBOUT releases the lock pending updates (LPU) exclusive lock on updated records and the single record enqueue (SRE) on the current record (if one exists) that were obtained by this thread. The transaction is ended for all participating threads and the backout and constraints log are freed.

Found sets are not released and the current record does not change. In a multithreaded transaction the LPU and SRE locks obtained by other threads are still held.

To ensure that all of the records and resource locks are released after the IFBOUT call executes in a multithreaded transaction, issue IFCMMT on all of the other single cursor IFSTRT threads participating in the transaction.

Note: A completed transaction cannot be backed out.

For more information about transaction backout, see HLI: Transactions.

Coding example (COBOL)

WORKING-STORAGE SECTION. 01 ARGS-FOR-CALL. 05 RETCODE PIC 9(5) COMP SYNC. . . . PROCEDURE DIVISION. . . . CALL "IFBOUT" USING RETCODE.