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 » General IBM MQ Support » Why do we need to call MQCLOSE/MQDISC

Post new topic  Reply to topic
 Why do we need to call MQCLOSE/MQDISC « View previous topic :: View next topic » 
Author Message
vandemon
PostPosted: Mon Jun 14, 2010 8:59 pm    Post subject: Why do we need to call MQCLOSE/MQDISC Reply with quote

Apprentice

Joined: 14 Jun 2010
Posts: 32

I'm new to Websphere MQ, and I am conducting a testing on WMQ using VB6. I found out that WMQ will automatically close the open input and open output after 5 second when my application closed. My application did not call any MQCLOSE or MQDISC upon form closing. So why do we need to call MQCLOSE/MQDISC eventhough the WMQ will close it for us?
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Jun 14, 2010 11:23 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Where are you looking to determine it has closed the handles?

It's good practice to do this explicitly. It can also affect the way any open syncpoint is handled.
Back to top
View user's profile Send private message
vandemon
PostPosted: Mon Jun 14, 2010 11:53 pm    Post subject: Reply with quote

Apprentice

Joined: 14 Jun 2010
Posts: 32

Thx a lot bro...
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Jun 15, 2010 5:21 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
It's good practice to do this explicitly.

It's a best practice in all programming languages to explicitly close what you open (files, for example). Most programming language reference manuals will tell you that the results of not closing what you open are unpredictable.

Unpredictable means that your results may vary by platform, version/release/modification level of MQ, the language translator, the o/s, and many other variables.

This same thought process applies to initializing variables, testing (validating) the presence of numbers before doing aritimetic, and so on. Hence, the best practice.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jun 15, 2010 9:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Every time you write an open statement in code, write the close statement.

Then put more code in between.
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 » General IBM MQ Support » Why do we need to call MQCLOSE/MQDISC
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.