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

Home -> Community -> Usenet -> c.d.o.server -> Re: How can I work around a race condition when using INSTEAD OF triggers on a view?

Re: How can I work around a race condition when using INSTEAD OF triggers on a view?

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Thu, 24 Mar 2005 06:25:51 +0100
Message-ID: <42424f0c$0$32179$626a14ce@news.free.fr>

<smauldin_at_ingrian.com> a écrit dans le message de news:1111626737.779856.221480_at_z14g2000cwz.googlegroups.com...
|
| I have a table called TEST_TRIG and a view on the table called
| TEST_TRIG_VIEW.
| I created an INSTEAD OF trigger on TEST_TRIG_VIEW to modify the table
| and other info
| when the view is updated. If two update statements from two different
| session execute an
| update that will modify a column in the where clause I see unexpected
| results. The second
| statement executes using the old column value in the where clause.
|
| statement 1: update TEST_TRIG_VIEW set EMPNO = 1111 where EMPNO = 1;
|
| statement 2: update TEST_TRIG_VIEW set EMPNO = 9999 where EMPNO = 1;
|
| commit statement 1
| commit statement 2
| I would expect statement 2 not to update any rows because statement
| changed the
| EMPNO value from 1 to 1111. This problem does not occur when performed
| on the table directly.

You're not updating the table using empno as a key but the rowid. You'll get exactly the same thing with the table if you use the rowid to update.

Regards
Michel Cadot Received on Wed Mar 23 2005 - 23:25:51 CST

Original text of this message

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