Threading

WebSphere MQ Automation Classes for ActiveX implement a free-threading model where objects can be used between threads.

While MQAX permits the use of MQQueue and MQQueueManager objects, WebSphere MQ does not currently permit the sharing of handles between different threads.

Attempts to use these on another thread result in an error and WebSphere MQ returns a return code of MQRC_HCONN_ERROR.

Note:
There is only one MQSession object per process. Using the MQSession CompletionCode and ReasonCode is not recommended in multithreaded environments. The MQSession error values may be overwritten by a second thread between an error being raised and checked on the first thread. Threads are serialized for the duration of each method call or property access. So, issuing a Get with the Wait option will cause other threads accessing MQAX objects to be suspended until the operation completes.