|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
about disconnect and close |
« View previous topic :: View next topic » |
Author |
Message
|
leo.yue |
Posted: Sat Apr 23, 2005 6:33 am Post subject: about disconnect and close |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
who can tell me the difference between disconnect and close on MQQueuemanager?
thanks a lot! |
|
Back to top |
|
 |
clindsey |
Posted: Sat Apr 23, 2005 9:30 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
I do not believe the MQQueueManager class has a close method. It only has a disconnect, which closes the connection to the queue manager and frees resources.
The managed mq objects, such as MQQueue have a close method. This is like any other close method. It indicates you are finished using the object and any open resources are freed.
BTW, a MQQueueManager disconnect will close any managed objects that you did not close.
Charlie |
|
Back to top |
|
 |
PeterPotkay |
Posted: Sat Apr 23, 2005 10:46 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I just checked, and in VB.net, the QM object does have a .close method, which I do not understand, as there is no .open method.
In COBOL, if you wanted to MQINQ the QM, you had to MQCONN to the QM, then MQOPEN the QM with the inquire option, do the MQINQ call against the open QM, MQCLOSE the QM, then MQDISC. But in Java and .NET, it looks like you can get those attributes of the QM as soon as you create the QM object, so the open method is not needed. Why the heck is there then a close method????
The manuals do not say anything about it even existing, but its there. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Apr 23, 2005 5:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Could it be that the disconnect method is invoking it ?? |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Apr 23, 2005 7:02 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Most object-oriented languages provide finallizers/destructors, code that an object can define that will get run just before that object is garbage-collected.
This allows things like queue manager objects to disconnect themselves, without needing explicit disconnect calls from application code - they know it's safe to disconnect because they know they are about to get deleted!
Likewise, it seems apparent that the QM object in question does a connect during it's constructor. So, again, you don't need to explicitly instruct it to connect - because by the time it's available to receive instructions, it's already connected. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
leo.yue |
Posted: Sun Apr 24, 2005 3:29 am Post subject: |
|
|
Acolyte
Joined: 20 Oct 2004 Posts: 52
|
Thanks for your reply
close method is in its super class - MQManagedObject |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|