openFor method" />
Reopen
An ImqObject is reopened automatically for any method that results in an MQGET, MQINQ, MQPUT, or MQSET call, where the object is already open, but the existing open options are not adequate to allow the MQI call to be successful. The object is temporarily closed using a temporary close options value of MQCO_NONE. Use the openFor method to add a relevant open option.
Reopen can cause problems in specific circumstances:
- A temporary dynamic queue is destroyed when it is closed and can never be reopened.
- A queue opened for exclusive input (either explicitly or by default) might be accessed by others in the window of opportunity during closure and reopening.
- A browse cursor position is lost when a queue is closed. This situation does not prevent closure and reopening, but prevents subsequent use of the cursor until MQGMO_BROWSE_FIRST is used again.
- The context of the last message retrieved is lost when a queue is closed.
If any of these circumstances occur or can be foreseen, avoid reopens by explicitly setting adequate open options before an object is opened (either explicitly or implicitly).
Set the open options explicitly for complex queue-handling situations results in better performance and avoids the problems associated with the use of reopen.