你实际测试一下,Oracle处理这种情况是完全回滚的;

解决方案 »

  1.   

    只有当子过程是自治的(autonomous),子过程的commit和rollback才不影响父过程.
      

  2.   

    子过程是自治的(autonomous)是什么意思,能不能说清楚点!
      

  3.   

    Autonomous  指在调用main transaction的上下文之外执行某些 SQL 操作组,比如你的子进程,提交或回滚这些操作并返回给调用main transaction的上下文,而不会丢失早先在主transaction中的工作.   You can code the pragma anywhere in the declarative section of a procedure, function, or PL/SQL block. But, for readability, code the pragma at the top of the section. The syntax follows: 
    PRAGMA AUTONOMOUS_TRANSACTION