|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Why do we need to call MQCLOSE/MQDISC |
« View previous topic :: View next topic » |
Author |
Message
|
vandemon |
Posted: Mon Jun 14, 2010 8:59 pm Post subject: Why do we need to call MQCLOSE/MQDISC |
|
|
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 |
|
 |
zpat |
Posted: Mon Jun 14, 2010 11:23 pm Post subject: |
|
|
 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 |
|
 |
vandemon |
Posted: Mon Jun 14, 2010 11:53 pm Post subject: |
|
|
Apprentice
Joined: 14 Jun 2010 Posts: 32
|
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jun 15, 2010 5:21 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Tue Jun 15, 2010 9:38 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|