Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有带有 PRAGMA AUTONOMOUS_TRANSACTION 的过程 A 来记录主程序的活动。
现在我在程序 B 中调用该程序 A 以在程序 B 中记录活动过程。如果程序 A 中发生任何错误,它也会使程序 B 失败。如何避免主程序失败 B.
该日志记录过程做了什么以使其可能失败?不是纯INSERT+COMMIT吗?
INSERT
COMMIT
无论如何:最简单(也可能是最糟糕的)选项是使用异常处理程序部分,例如
your_procedure is begin do something; exception when others then null; end;
如果您真的不在乎是否发生了不好的事情,那也没关系,但是-目的是什么?你认为你做了什么,甲骨文没有抱怨,程序什么也不做,你不知道发生了什么。
因此,您最好确保此“记录”过程不会失败。