Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Optimistic Locking

Optimistic Locking

From: Stephan Gutschke <stephan_at_gutschke.com>
Date: Fri, 08 Mar 2002 00:39:00 +0100
Message-ID: <3C87FA14.8080603@gutschke.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US