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).
| Sync level | Command sequence |
|---|---|
| 0 | SEND LAST WAIT |
| 1 | SEND LAST CONFIRM |
| 2 | SEND LAST |
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.
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.