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

Home -> Community -> Mailing Lists -> Oracle-L -> Questions for Oracle list

Questions for Oracle list

From: John Dunn <john.dunn_at_sefas.co.uk>
Date: Mon, 10 Feb 2003 09:03:53 -0800
Message-ID: <F001.005486D8.20030210090353@fatcity.com>

> Question 1)
>
> I've got a update trigger on a table that updates a record in another
> table.
>
> i.e.
>
> CREATE OR REPLACE TRIGGER table1_trigger_update
> BEFORE UPDATE ON table1
> FOR EACH ROW
> BEGIN
>
> UPDATE
> Table2
> SET
> Table2.version = Table2.version + 1
> WHERE
> Table2.job_id = :new.job_id;
>
> END;
>
> The question is - at what stage does Oracle attempt to get a lock in the
> table referenced in the trigger? Does Oracle attempt to lock the Table2
> row at the same time as locking the Table1 row, or does it attempt to lock
> when the COMMIT is finally done?
>
> Question 2)
>
> When there is a deadlock situation is it the bit of SQL that starts the
> deadlock that gets the exception? This is the way I thought it worked, but
> I'm sure I've seen different bits of code getting the exception in
> identical circumstances.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: John Dunn
  INET: john.dunn_at_sefas.co.uk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon Feb 10 2003 - 11:03:53 CST

Original text of this message

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