2042 (07FA) (RC2042): MQRC_OBJECT_IN_USE

Explanation

An MQOPEN call was issued, but the object in question has already been opened by this or another application with options that conflict with those specified in the Options parameter. This arises if the request is for shared input, but the object is already open for exclusive input; it also arises if the request is for exclusive input, but the object is already open for input (of any sort).

MCAs for receiver channels, or the intra-group queuing agent (IGQ agent), may keep the destination queues open even when messages are not being transmitted; this results in the queues appearing to be in use. Use the MQSC command DISPLAY QSTATUS to find out who is keeping the queue open.

IBM® MQ opens a queue for shared input if the application uses the MQOO_INPUT_SHARED open option or, if the application uses MQOO_INPUT_AS_Q_DEF and the default sharing option queue attribute is set to DEFSOPT(SHARED). However, there is an administrative override in the form of the SHARE/NOSHARE option.

If the queue definition shows NOSHARE, then IBM MQ will make the input handle exclusive regardless of the options set by the application.

  • [z/OS]On z/OS®, this reason can also occur for an MQOPEN or MQPUT1 call, if the object to be opened (which can be a queue, or for MQOPEN a namelist or process object) is in the process of being deleted.
  • [z/OS]The default setting on z/OS is NOSHARE.

Completion code

MQCC_FAILED

Programmer response

System design should specify whether an application is to wait and retry, or take other action.