|  | 
 | ||||
|  | ||||||
| Related Topics | Other Library Functions | |||||
| function | mq-commit | 
define external function mq-commit connection value mq-connection connection
Argument definitions
Use mq-commit to commit an active IBM MQSeries unit of work.
You must include the following line at the beginning of your OmniMark program:
include "ommqi.xin"
The connection object must be connected (else external exception OMMQI0011).
This function corresponds to the MQCMIT function in the MQSeries API.
The CompCode and Reason parameters of MQCMIT are integrated into the OMMQI error handling.
Commit two messages added to a queue as part of a transaction, so that
they appear simultaneously.
     local mq-connection       a-connection
     local mq-object               a-object
     local stream                 od-fields   variable
     local mq-object-descriptor   a-mqod
     local stream                 md-fields   variable
     local mq-message-descriptor  a-mqmd
     local stream                 pmo-fields  variable
     local mq-put-message-options a-mqpmo
  
     ; Connect to queue manger
     set a-connection to mq-connect
  
     set new od-fields {"ObjectName"} to "default"
     mq-set-object-descriptor a-mqod to od-fields
  
     ; Open queue
     set a-object to mq-open connection a-connection
           object-descriptor a-mqod
           options MQOO_OUTPUT
  
     ; Initialize structure for putting message. Specify we want to start
     ; a unit of work
     set new pmo-fields {"Options"} to
            "d" % (MQPMO_NEW_MSG_ID union
                   MQPMO_NEW_CORREL_ID union MQPMO_SYNCPOINT)
     mq-set-put-message-options a-mqpmo to pmo-fields
  
     set new md-fields {"Format"} to MQFMT_STRING
     mq-set-message-descriptor a-mqmd to md-fields
  
     ; Put message 1 in the queue
     mq-put object a-object
              message-descriptor a-mqmd
              put-options a-mqpmo
              message "This is a test message."
  
     ; Put message 2 in the queue
     mq-put object a-object
              message-descriptor a-mqmd
              put-options a-mqpmo
              message "This is another test message."
  
     ; Commit the messages so they can be gotten
     mq-commit connection a-connection
| Related Topics | Other Library Functions | 
Copyright © Stilo International plc, 1988-2010.