Author |
Message
|
saurabh867 |
Posted: Sun Jun 27, 2010 8:57 pm Post subject: Access ExceptionList in Exit Handler |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Hi,
Is it possible to access the ExceptionList in the handler part of the exit handler.
I have defined an exit handler for a DB operation and want to log the entire exception list inside the handler part but while debugging I could not see the ExceptionList inside the hadler part..
Any idea how to get that? |
|
Back to top |
|
 |
mgk |
Posted: Mon Jun 28, 2010 1:08 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Look up the LOG statement. _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
saurabh867 |
Posted: Mon Jun 28, 2010 7:42 am Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Actually I want to access the SQLSTATE and Error code etc..., the way we can get in the compute node if we connect the failure terminal of the node throwing exception.
Basically, the way one can debug excpetion list in java after catching.
Is there any work around to replicate the same inside the handler.
Thanks in Advance
Saurabh |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jun 28, 2010 9:11 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
saurabh867 wrote: |
.
Basically, the way one can debug excpetion list in java after catching.
|
IMHO, this is far easier to do in ESQL. I'm sure there will be readers of this forum who would like to know why you want to do this in Java?
Or, are you one of those shops that insist that all error handling is done with Jave & Log4j? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jun 28, 2010 10:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
smdavies99 wrote: |
saurabh867 wrote: |
.
Basically, the way one can debug excpetion list in java after catching.
|
IMHO, this is far easier to do in ESQL. I'm sure there will be readers of this forum who would like to know why you want to do this in Java?
Or, are you one of those shops that insist that all error handling is done with Jave & Log4j? |
Urm. I'm reading saurabh867 as saying they WANT to do this in ESQL, as easily as they CAN do it in java, but that it's not that easy.
AFAIK, the DECLARE HANDLER block does not build the ExceptionList tree when it calls the handler. But perhaps MGK will get a little more verbose on this - and take an opportunity to correct me on this subject. |
|
Back to top |
|
 |
mgk |
Posted: Mon Jun 28, 2010 11:37 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
AFAIK, the DECLARE HANDLER block does not build the ExceptionList tree when it calls the handler. But perhaps MGK will get a little more verbose on this - and take an opportunity to correct me on this subject. |
Hi Jeff
As you say, the ExceptionList is not available inside a Handler. However, you can use the SQLCODE, SQLSTATE, SQLNATIVERROR and SQLERRORTEXT to get the these details from the exception inside the handler. These values will be as per their names if the exception is a DB exception, or one of the ones mentioned in the SQLSTATE docs. They can also be user values if it is a user exception.
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
saurabh867 |
Posted: Mon Jun 28, 2010 9:21 pm Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Thanks,
I got my answer. SQLCODE,SQLERRORTEXT are sufficient enough to trace back the cause of error.
Actually I was trying to figure out these in the Debug mode but somehow these variables dont appear in the debugger but are accessible for logging.
Thanks for help |
|
Back to top |
|
 |
|