Author |
Message
|
jolonm |
Posted: Thu Jan 01, 2009 10:52 pm Post subject: why MQ is not returning error to the application? |
|
|
Apprentice
Joined: 31 Dec 2008 Posts: 25
|
Can any tell me why MQ is not returning error to the application?
i am using C#.net.
Basically few days back i got below message in mq log file, but not exception were generated in the appliation:
AMQ7469: Transactions rolled back to release log space. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 02, 2009 2:29 am Post subject: Re: why MQ is not returning error to the application? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
Can any tell me why MQ is not returning error to the application? |
Because as I said here your 110% correct code isn't all that correct! It's certainly not handling UOW correctly or you wouldn't be filling the log!
WMQ almost certainly is returning an exception but for whatever reason your code's not reacting properly or at all.
Standard language diagnostic tools would seem to be the next obvious step. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jolonm |
Posted: Fri Jan 02, 2009 3:54 am Post subject: |
|
|
Apprentice
Joined: 31 Dec 2008 Posts: 25
|
Quote: |
Because as I said here your 110% correct code isn't all that correct! |
Ok, Let me give you code now, tell me what is wrong here:
try
{
InitializeQueue();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.WaitInterval = 1;
if(m_QueueConfiguration.IsTransactional)
gmo.Options |= MQC.MQPMO_SYNCPOINT;
MQMessage msg = new MQMessage();
m_Queue.Get(msg, gmo);
return msg;
}
catch (MQException mqe)
{
if (mqe.Reason == MQC.MQRC_NO_MSG_AVAILABLE)
{
return null;
}
else
{
throw new Exception("MQ Exception occured", mqe);;
}
} |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 02, 2009 4:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
Ok, Let me give you code now, tell me what is wrong here: |
- this is a fragment of a larger program and gives no clue as to how exceptions are processed when thrown;
- the msg variable is a global, so it's impossible to determine how it's managed (this refers to your previous problem)
- even this simple fragment contains the howlingly obvious blunder my associate pointed out in the previous thread, where a put message option is used to set the get message options
- there's no UOW handling shown, which is the root cause of your problems
That's just on a cursitory inspection. I'm 110% certain there are others if you look through the rest of the code.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jolonm |
Posted: Fri Jan 02, 2009 4:50 am Post subject: |
|
|
Apprentice
Joined: 31 Dec 2008 Posts: 25
|
Quote: |
exceptions are processed when thrown; |
the Catch block in given code have not received error, and this is the issue. |
|
Back to top |
|
 |
jolonm |
Posted: Fri Jan 02, 2009 4:52 am Post subject: |
|
|
Apprentice
Joined: 31 Dec 2008 Posts: 25
|
...
Last edited by jolonm on Sun Jan 04, 2009 9:38 pm; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 02, 2009 5:16 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
the Catch block in given code have not received error, and this is the issue. |
And you know this how? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 02, 2009 5:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
Can you please explain me litter more about 'UOW handling shown'. |
So not only do you not know the difference between get option & put options, you don't even understand what the option you're trying to set does?
Training. Get Some. Reading. Do Some. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 02, 2009 8:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jolonm wrote: |
Quote: |
exceptions are processed when thrown; |
the Catch block in given code have not received error, and this is the issue. |
And how would you know as you have narrowed the exceptions you track to the MQException only? What if the exception is thrown as an IO exception because of the wrong option?
You should be catching known exception types that you want to handle first, and then have a catch all of type Exception or Throwable with some generic error handling.
Thus you should see anything messing up in the catch all exception block...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jan 02, 2009 8:25 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
You should be catching known exception types that you want to handle first, and then have a catch all of type Exception or Throwable with some generic error handling. |
This is one of those programming best practice thingies, and not unique to WMQ. _________________ 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 |
|
 |
jolonm |
Posted: Sun Jan 04, 2009 9:33 pm Post subject: |
|
|
Apprentice
Joined: 31 Dec 2008 Posts: 25
|
Quote: |
And how would you know as you have narrowed the exceptions you track to the MQException only? What if the exception is thrown as an IO exception because of the wrong option?
You should be catching known exception types that you want to handle first, and then have a catch all of type Exception or Throwable with some generic error handling.
Thus you should see anything messing up in the catch all exception block... |
Quote: |
This is one of those programming best practice thingies, and not unique to WMQ. |
I know what is best practice and what not.
Check the code closely and then reply to the question.
If I am catching MQException here, it means all other exception will be implicitly thrown to parent method (calling method), and there we must be catching exception, and even if I am not catching other than MQException anywhere it means program will abnormally end.
So please concentrate on main question and answer me if you can... |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jan 04, 2009 9:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you obviously don't like the reply, why do you ask the question?
Have you tried any of the resolution avenues offered yet? What was the result?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jolonm |
Posted: Sun Jan 04, 2009 10:34 pm Post subject: |
|
|
Apprentice
Joined: 31 Dec 2008 Posts: 25
|
Quote: |
If you obviously don't like the reply, why do you ask the question? |
This is obvious that if application does not handle the exception, it will terminate abnormally. So then what is the sence of replying “if the exception is thrown as an IO exception because of the wrong option” or “programming best practice”.
My question was basically related to MQ is not returning exception, as I clearly said that application has not received any error from MQ. Hence I wanted to check that whether there is any setting in MQ or anything related to GMO options which are missing. As I said I am new in MQ and might miss things, so please let me know what all can be…, I highly appreciate if you can help.
Do you think, setting MQC.MQPMO_SYNCPOINT instead of MQC.MQGMO_SYNCPOINT when building GMO might also be the reason of not receiving any error from MQ? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 05, 2009 2:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jolonm wrote: |
This is obvious that if application does not handle the exception, it will terminate abnormally. So then what is the sence of replying “if the exception is thrown as an IO exception because of the wrong option” or “programming best practice”. |
The sense is because you're clearly having some issues with some basic concepts.
jolonm wrote: |
Do you think, setting MQC.MQPMO_SYNCPOINT instead of MQC.MQGMO_SYNCPOINT when building GMO might also be the reason of not receiving any error from MQ? |
I think you should start listening to what people are saying in this thread, stop throwing round wild claims about the perfection of your code and start using some of the advice being given.
Or just assume you're right and we're wrong. In this case you should abandon posting here and raise a PMR with IBM, complaining that the software is not returning an exception to the application in your set of circumstances.
Who knows, you might have discovered a fault in WMQ. They do exist. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jolonm |
Posted: Mon Jan 05, 2009 3:09 am Post subject: |
|
|
Apprentice
Joined: 31 Dec 2008 Posts: 25
|
Ok, let’s stop claiming each other.
i am here to get help because i also believe on:
Never assume you know everything.
Never assume you've seen everything.
So please let’s come back on track and let me know possible causes… |
|
Back to top |
|
 |
|