3.1.4.4 Transaction Commit

This event MUST be generated with the following argument:

Return Value:

  • rStatus: A status code that can be one of the following:

    • MQ_OK (0x00000000)

    • MQ_ERROR_TRANSACTION_SEQUENCE (0xC00E0051)

The queue manager MUST perform the following actions to process this event:

  • Retrieve the Transaction (section 3.1.1.14) ADM element instance, referred to as transObj, from the LocalQueueManager.TransactionCollection for which the transObj.Identifier ADM attribute value matches the iTransactionIdentifier argument.

  • If a Transaction ADM element instance is not found, set rStatus to MQ_ERROR_TRANSACTION_SEQUENCE and take no further action.

  • For each TransactionalOperation (section 3.1.1.13) ADM element instance, referred to as transOp, in transObj.TransactionalOperationCollection:

    • If transOp.OperationType is Enqueue:

    • Else if transOp.OperationType is Dequeue:

      • Generate a Message Position Deleted (section 3.1.7.2.1) event with the following arguments:

        • iQueue := transOp.MessagePositionReference.QueueReference

        • iPosition := transOp.MessagePositionReference

        • iReason := transOp.DequeueReason

    • Else if transOp.OperationType is Move:

      • Set transOp.MessagePositionReference.State to Deleted.

      • Create a new MessagePosition (section 3.1.1.11) ADM element instance, referred to as newMessagePos, in transOp.TargetQueueReference and set newMessagePos.MessageReference to transOp.MessagePositionReference.MessageReference. The queue manager MUST create this new MessagePosition ADM element instance inĀ  transOp.TargetQueueReference according to the rules specified for Queue.MessagePositionList.

      • Generate a Message Position Available (section 3.1.7.2.2) event with the following arguments:

        • iQueue := transOp.TargetQueueReference

        • iPosition := newMessagePos

    • Remove transOp from transObj.TransactionalOperationCollection.

  • Remove the Transaction ADM element instance transObj from LocalQueueManager.TransactionCollection.

  • Set rStatus to MQ_OK.