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: PACKAGEs; exception propagation

Re: PACKAGEs; exception propagation

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Mon, 10 Jun 2002 14:46:53 +0400
Message-ID: <ae202u$md4$1@babylon.agtel.net>


Ahem....

  1. When you change a single line of code in your Java class that exports some 50 methods - do you recompile this line only or the whole class? Compare compile times of single Java class with 50 complex methods, and of single PL/SQL package body with 50 complex procedures - I doubt you'll see big difference in most cases. Also, DO NOT recompile the package specification each time you change implementation of a procedure (if this change does not alter the procedure call specification). In fact, doing this will cascadingly invalidate all dependent packages and/or procedures and you will have to recompile them too. You should only recompile the package BODY as this operation does not invalidate dependent objects even if unsuccessful.
  2. Exceptions in called procedures DO propagate to CALLERS first, and if unhandled there, they bubble up the chain until they are handled, and an Oracle error corresponding to the initial exception will be finally thrown to the host if none of the chain members caught and handled it. Can you provide an example that exhibits different behavior?
-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"ronald" <ronald_at_foo.com> wrote in message news:adtalu$26jqq$1_at_ID-87429.news.dfncis.de...

>
> "Sybrand Bakker" <postbus_at_sybrandb.demon.nl>
>
>
> > 1 recompiling a package body usually takes less than a
> > minute. Are you really so impatient that you consider that
> > to be 'awkward'?
>
> The need to compile _entire_ package body, for just a
> minor change in a procedure, _is_ awkward.
>
> Right now there are 54 procedures in my package.
> For each and every tiny change I have to compile
> them all.
>
> That's suboptimal. And that's the reason why dependencies,
> MAKE, ant... were invented.
>
>
> > 2 You didn't read Connor's reply.
> > If you define exception in a package header you can trap them from a
> > calling procedure. If the calling procedure is outside the package you
> > can trap them in the calling procedure using
> > <package_name>.<exception_name> That might be 'awkward'
> > again, but that's the way it is.
>
>
> What about the following scenario: I have procedures
> P1 and P2 which are
> standalone procedures, ie do not belong to any package.
> Procedure P1 calls P2. Procedure P2 raises an Oracle
> exception. Ultimately, P2 exits to host environment,
> and NOT to P1.
>
> What I would like to do, is to catch all Oracle exceptions
> (raised in called procedure P2) in the calling procedure
> P1, so that if P2 fails, P1 continues with processing.
> But unfortunately that's not possible. Whenever I
> encounter an exception in P2, calling procedure P1
> exits as well.
>
>
>
>
Received on Mon Jun 10 2002 - 05:46:53 CDT

Original text of this message

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