Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle For Fun

Re: Oracle For Fun

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sun, 01 Feb 2004 11:37:29 -0800
Message-ID: <1075664194.516102@yasure>


Tony wrote:

> Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1075568670.136040_at_yasure>...
> 

>>Tony wrote:
>>
>>
>>>"Niall Litchfield" <niall.litchfield_at_dial.pipex.com> wrote in message news:<401ae429$0$10057$cc9e4d1f_at_news.dial.pipex.com>...
>>>
>>>
>>>>"Tony" <andrewst_at_onetel.net.uk> wrote in message
>>>>news:c0e3f26e.0401301236.2b11876a_at_posting.google.com...
>>>>
>>>>
>>>>>Why would a production environment require redundant error handling
>>>>>and variable declarations? ;o)
>>>>
>>>>Variable declarations for readability essentially.
>>>>A do nothing error handler for when the code gets changed to do something
>>>>that might actually throw errors. People always exclude error handling from
>>>>their code. It is almost always a mistake.
>>>
>>>
>>>I tend to the opposite view: some people put too much error handling
>>>in their code, sometimes resulting in unwanted behaviour. Without
>>>explicit error handling, the worst that happens is you get a terse
>>>error message; with bad error handling, you may never know there was
>>>an error.
>>
>>I think you're taking a bit too much of a "position". Lets look at this
>>from a different perspective. Is there any excuse for putting any code
>>in a database that does not have an exception handler?
>>
>>I can think of only one ... a procedure that logs errors in which case
>>you want the app to blow up if it ever fails because its failure would
>>mean that errors are not being logged.
>>
>>Having established, I hope, that there is only a few very rare cases
>>where an exception handler isn't required ... the question of what
>>constitutes too much or too little becomes academic.
>>
>>The amount of exeption handling should be complete enough to trap all
>>possible errors, log them if appropriate, and either continue processing
>>or exit gracefully.
>>
>>But from my experience ... I've seen thousands of cases of none ...
>>never a case of too much. Your mileage may vary.
> 
> 
> Possibly.  I find I tend to agree with Tom Kyte's take on exception
> handling, for example here:
> 
> http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1939254308449

I absolutely agree with both you and Tom. One of the things I see far too little of is PRAGMA EXCEPTION_INIT. And only rarely do I see user defined application specific exception handling.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Feb 01 2004 - 13:37:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US