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