Re: getting error ORA-4091 (mutating table), what is workaround while still enforcing RI

From: Sybrand Bakker <gooiditweg_at_nospam.demon.nl>
Date: Thu, 29 Sep 2005 23:18:28 +0200
Message-ID: <tcmoj15pfgahvn13f55ufa47unnflaskoe_at_4ax.com>


On 29 Sep 2005 10:13:03 -0700, "jeffchirco_at_gmail.com" <jeffchirco_at_gmail.com> wrote:

>I have a child parent releationship going. And I want to enforce
>referential
>integrity with triggers. When I update the parent table I want it to go
>down
>and update the child. But if I update the child it needs to check to
>make sure
>there is a matching parent.
>So I have a trigger after udate on the parent table that goes and
>updates all
>the childs.

Enforcing RI by means of triggers is unnecessary, as there are constraints.
Also checking RI using constraints is about 8 times faster, as checking RI using triggers.
If you check RI using constraints you don't need to select from the parent table and you wouldn't run into this particular problem.

I think you need to revise your strategy.

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Sep 29 2005 - 23:18:28 CEST

Original text of this message