swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

mq-backout

 
 

Library: MQSeries access (OMMQI) legacy
Include: ommqi.xin

Declaration

define external function mq-backout
  connection              value       mq-connection   connection

Argument definitions

connection
is a connected mq-connection object.


Purpose

Use mq-backout to roll back an active IBM MQSeries unit of work.

Requirements

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).

Usage Notes

This function corresponds to the MQBACK function in the MQSeries API.

The CompCode and Reason parameters of MQBACK are integrated into the OMMQI error handling.

Example

Add a message to a queue as part of a transaction, and then back it out so no-one can get it.

     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 in the queue
     mq-put object a-object
              message-descriptor a-mqmd
              put-options a-mqpmo
              message "This is a test message."
  
     ; Backout the message so nobody can get it
     mq-backout object a-object

    Related Syntax
   mq-commit
 
  Other Library Functions
   mq-backout
   mq-close
   mq-commit
   mq-connect
   mq-connection
   mq-connectx
   mq-disconnect
   mq-get
   mq-get-entire-return-status
   mq-get-function-status
   mq-get-logging-level
   mq-get-throw-on-warnings
   mq-inquire
   mq-inquire-names
   mq-object
   mq-open
   mq-put
   mq-put1message
   mq-set
   mq-set-logging-level
   mq-set-throw-on-warnings
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.