Hi!
I tried searching everywhere to find some documentation about this, but I couldn't, so I'm asking here:
As far as I can understand the Oracle Documentation EXCEPTION WHEN OTHERS should catch all unhandled Exceptions!!!
But then I stumbled upon ORA-01013 which is User Cancelled... And which just slips right through WHEN OTHERS
DECLARE
e_cancelled EXCEPTION;
PRAGMA EXCEPTION_INIT(e_cancelled, -1013);
BEGIN
BEGIN
RAISE e_cancelled;
EXCEPTION
WHEN OTHERS THEN
-- All Exceptions should be logged here, but starting with Patch 11.2.0.4.0
-- WHEN OTHERS is NO LONGER TRIGGERED :-o what to do???
DBMS_OUTPUT.PUT_LINE('EXCEPTION OTHERS');
END;
EXCEPTION
WHEN e_cancelled THEN
-- The Exception has to be handled individually
DBMS_OUTPUT.PUT_LINE('EXCEPTION CANCELLED');
END;
/
My research brought me to the Oracle Changelogs, which show with the latest update "ORA-01013 is not catched by WHEN OTHERS anymore"
So this seems to be desired (albeit undocumented???) behaviour... https://support.oracle.com/epmos/faces/DocumentDisplay?id=12838063.8
My Question:
We use detailed error-logging and tracing in our database, catching logging and reraising all errors with "WHEN OTHERS"
is there any Setting or parameter to let the WHEN OTHERS handler catch this exception, or will I have to change hundreds
of packages to insert an additional WHEN ORA-01013 into every method???
Aside from Error-logging, what is with closing of cursors, releasing of ressources ??? Because there is no finally-block in
PL/SQL I usually use BEGIN, EXCEPTION, END like a try-catch block and cleanup after the exception block, but when
a timeout occurs, all that cleanup code will simply be skipped???
Message was edited by: FalcoW
Inserted Link to Oracle Changelog for a better understanding when the change occured...