Ending the conversation

The following sections describe the different ways a conversation can end, either unexpectedly or under transaction control. To end a conversation, one transaction issues a request for termination and the other receives this request. Once this has happened the conversation is unusable and both transactions must issue a FREE command to release the session.

Normal termination of a conversation

The SEND LAST command is used to terminate a conversation. It should be used in conjunction with either the WAIT or CONFIRM options, the SYNCPOINT command, or the WAIT CONVID command (depending on the conversation sync level). This is described in Table 8.

Table 8. Command sequences for ending a conversation
Sync level Command sequence
0
SEND LAST WAIT
FREE
1
SEND LAST CONFIRM
FREE
2
SEND LAST3
SYNCPOINT
FREE

From the state tables it can be seen that it is possible to end a conversation by issuing the FREE command, provided the conversation is in send state (state 2). This will generate an implicit SEND LAST WAIT command before the FREE is executed and is therefore not recommended for conversations using sync levels 1 and 2.

Note:
A distributed transaction should not end a conversation by issuing an EXEC CICS® RETURN command, but instead follow the sequence of commands shown in Table 8. The issue of an EXEC CICS RETURN could lead to one or both transactions ending abnormally.

Emergency termination of a conversation

The ISSUE ABEND command provides a means of abnormally ending the conversation. It is valid for all levels of synchronization, but should be avoided at sync level 2, because its use at the wrong time can lead to a loss of data integrity.

ISSUE ABEND can be issued by either transaction, irrespective of whether it is in send or receive state, at any time after the conversation has started. For a conversation in send state (state 2), any deferred data that is waiting for transmission is flushed before the ISSUE ABEND command is transmitted.

The transaction that issues the ISSUE ABEND command is not itself abended. It must, however, issue a FREE command for the conversation unless it is designed to terminate immediately.

If an ISSUE ABEND command is issued in receive state (state 5), CICS purges all incoming data until an INVITE, syncpoint request, or LAST indicator is received. If LAST is received, no abend indication is sent to the partner transaction.

If an ISSUE ABEND is received, CICS abends the transaction with abend code AZCH, sets on EIBERR(=X'FF'),EIBFREE(=X'FF'), and places X'0864' in the first two bytes of EIBERRCD.

Unexpected termination of a conversation

If a partner system fails, or a session goes out of service in the middle of a DTP conversation, the conversation is terminated abnormally and the TERMERR condition is raised on the next command that accesses the conversation. In addition, EIBERR and EIBFREE are set on (X'FF') and EIBERRCD contains a value representing the reason for the error, as follows:


3.
It is important that the SEND LAST command for sync level 2 is not accompanied by WAIT or CONFIRM because either of these options will cause the conversation to end before the subsequent syncpoint has propagated to the partner transaction. This may mean that protected resources of one transaction could be committed while those in the partner transaction could be backed out. The resulting state errors may also lead to the session being unbound.

[[ Contents Previous Page | Next Page Index ]]