In situations where one procedure-P1 calling another
procedure P2, there are many things to be considered, like,
Whether exception in the called-procedure P2 is
handled or not?
- If handled, what effects are applied by PLSQL on the DMLs-happened, just before the exception thrown on the transaction?
- If NOT handled what effects are applied by PLSQL on the DMLs-happened, just before the exception thrown on the transaction?
If P2 has handled the exception-raised,
then block of P2 terminates, and the control goes to P1, and the DMLs of p2,
just before the exception thrown, REMAIN AS PART OF THE TRANSACTION.
If P2 has NOT handled the-exception-raised,
then the block of P2 terminates, and the control goes to EXCEPTION HANDLING
PART OF P1 [exception-propagation]. Now
the DB WORK is not ROLLED BACK.
If the exception is handled by P1, then all DMLs of P1and P2 remain part of transaction.
If the exception is NOT handled by P1 also, P1 terminates abruptly, and the exception propagates to the calling environment. All DMLs of P2 and P1 are rolled back. The host-environment determines the outcome for the unhandled exception.
No comments:
Post a Comment