Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Optimistic Locking
Hi there,
I have got an application which reads data from several database tables
and stores it in local objects.
Some time later I want to find out if the data which I read previously
and which is stored in my local objects is still equal to the one stored
in the database. In order to accomplish this easily, I thought about
creating a trigger which always updates an extra column in my tables
once the table is updated. The extra column would just store a number
which would be increased by one through the trigger. Ups, there I got
the ORA 4091 trigger error of mutating tables. Does anyone has a simple
idea on how to solve this problem?
And another question. Does anyone know why this 4091 exists? I am a little confused here, I thought if one declares the trigger with the "AFTER" keyword, than that means, after everything (updates, inserts) is done, the trigger is fired. Why does oracle think that there is a problem?
Thanx to everyone,
Stephan
P.S.:
I am using oracle 8i on W2K. Programming with Java.
Received on Thu Mar 07 2002 - 17:39:00 CST
![]() |
![]() |