相关疑难解决方法(0)

ORA-04091:表[blah]正在变异,触发器/函数可能看不到它

我最近开始研究一个大型的复杂应用程序,我刚刚因为这个错误而被分配了一个错误:

ORA-04091: table SCMA.TBL1 is mutating, trigger/function may not see it
ORA-06512: at "SCMA.TRG_T1_TBL1_COL1", line 4
ORA-04088: error during execution of trigger 'SCMA.TRG_T1_TBL1_COL1'
Run Code Online (Sandbox Code Playgroud)

有问题的触发器看起来像

    create or replace TRIGGER TRG_T1_TBL1_COL1
   BEFORE  INSERT OR UPDATE OF t1_appnt_evnt_id ON TBL1
   FOR EACH ROW
   WHEN (NEW.t1_prnt_t1_pk is not  null)
   DECLARE
        v_reassign_count number(20);
   BEGIN
       select count(t1_pk) INTO v_reassign_count from TBL1
              where  t1_appnt_evnt_id=:new.t1_appnt_evnt_id and t1_prnt_t1_pk is not null;
       IF (v_reassign_count > 0) THEN
           RAISE_APPLICATION_ERROR(-20013, 'Multiple reassignments not allowed');
       END IF;
   END;
Run Code Online (Sandbox Code Playgroud)

该表具有主键" t1_pk","约会事件id" t1_appnt_evnt_id和另一列" …

oracle triggers hibernate ora-04091

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

hibernate ×1

ora-04091 ×1

oracle ×1

triggers ×1