Communications/Transactions Guide and Reference

Step 7: Disconnecting from the queue

When a program that has connected to a queue manager has finished all interaction with the queue, it must break the connection.

| rc |
 
"Sample App 1: Disconnecting from the queue manager established
 in step 1 and verifying the disconnect"
(rc := aQueueManager disconnect) isAbtError
       ifTrue: [CICSTTY cr;
                show: 'Disconnect from Queue Manager failed
                       with return code: ',
                      (aQueueManager lastError codesAsString)]
       ifFalse: [CICSTTY cr;
                 show: 'Disconnect to Queue Manager ', (self queueManagerName),
                       ' is OK.'].
Note:You can close a queue and disconnect from the queue manager in a single step by using the disconnect method of AbtMQqueue. This is useful if you are using only one queue.

The connection obtained using the connection spec in Sample Application 2 must also be disconnected:

| result |
 
"Sample App 2: Disconnecting the connection obtained in steps 1 and 2
 and verifying the disconnect"
(result := anMQConnection disconnect) isAbtError
        ifTrue: [Transcript cr;
                        nextPutAll: ('Disconnect error: ', result codesAsString)].


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]