Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Avoiding "ORA-04091 table string.string is mutating"
On Tue, 04 Nov 2003 19:22:51 +0800, Connor McDonald wrote:
> Carlo Sirna wrote:
> > > The basic mutating table avoidance is: > > before-statement-trigger: > clear a PL/SQL table > > after-row: > add rowid for this row to PL/SQL table > > after-statement-trigger: > use each rowid and do the work you would have liked to have done > within the row level trigger > > > Easy enough - but if you have concurrent users modifying this table, you > will need to use something like dbms_lock or a sentinel table to control > access to the table whilst you do your work. > > Connor
And, I'll say it, since Connor implied it, but didn't spell it out: I hate this design, it screams of serialization problems. That is, the "dbms_lock or a sentinel table" that Connor mentions is likely to really hurt you in terms of scalability. If you expect to support a significant number of concurrent users, now is the time to reconsider your design, if possible.
-Mark Received on Tue Nov 04 2003 - 08:47:53 CST