ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » about disconnect and close

Post new topic  Reply to topic
 about disconnect and close « View previous topic :: View next topic » 
Author Message
leo.yue
PostPosted: Sat Apr 23, 2005 6:33 am    Post subject: about disconnect and close Reply with quote

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
View user's profile Send private message
clindsey
PostPosted: Sat Apr 23, 2005 9:30 am    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Sat Apr 23, 2005 10:46 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Apr 23, 2005 5:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Sat Apr 23, 2005 7:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
leo.yue
PostPosted: Sun Apr 24, 2005 3:29 am    Post subject: Reply with quote

Acolyte

Joined: 20 Oct 2004
Posts: 52

Thanks for your reply

close method is in its super class - MQManagedObject
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » about disconnect and close
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.