dbms_output at exception time

I tried this in the Test Window:

Code:
begin
  dbms_output.put_line('Does this output appear?');
  raise_application_error(-20000, 'An exception');
end;

The output does indeed appear on the "DBMS Output" page. Can you confirm this?
 
I had similar issues when working with code that used DB-links to execute remote code and that remote DB raised exceptions that were not handled by "local" code (leaving distributed transaction open). In case of some exception types PL/SQL Developer did not retrieve DBMS_OUTPUT data (I had to execute some other code, eg. "begin null; end;" in that same window to make it retrieve what was left in the DBMS_PUTPUT buffer).
I can't specify the exact exception types that caused this behaviour as I did not make any notes and can't reproduce the behaviour now. I'm also not sure if the problem occured only in Test Window (I think it was SQL Window too).
 
Back
Top