Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

autonomous transactions and exceptions

User_5OAFPFeb 8 2013 — edited Feb 8 2013
I'm a bit confused about autonomous transactions and exceptions.

1) are autonomous transactions quite right approach to perform logging into customer "audit" tables no matter invoking transaction commits or rollbacks?

2) assuming the scenario in which autonomous procedure inserts a row into customer audit table, what should be done when something wrong happens during such insert? should this situation be handled inside autonomous procedure or somewhere else? I couldn't find an example for this, I just found examples like this one below without handling errors:
procedure commit_test
is
pragma autonomous_transaction;
begin
  insert into audit_emp values (1,'Test','Test', user,sysdate);
commit;
end;
I would appreciate your opinion based on good practices or personal experience

thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2013
Added on Feb 8 2013
6 comments
2,001 views