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 -> deadlock while in trigger.

deadlock while in trigger.

From: Hugues Landry <landryh_at_discreet.com>
Date: 21 Jan 2002 09:19:14 -0800
Message-ID: <e7f97714.0201210919.674de895@posting.google.com>


Hi,

   I'm trying to map a c++ object model ( container pattern ) into oracle table.

   As you'll see in this code segment, I'm trying to delete from the table in a trigger when those entry become invalid. At first, i was deleting directly from the trigger but this gave me an 'table is mutating' error, which is a good thing after you get trough the frustration :-)

   Then i though, well if i do it in a autonomous transaction, it should do the trick.... Here's what i did.


insert into vector2 values( 1, 0, 0 );
insert into vector2 values( 2, 0, 0 );
insert into vector2 values( 3, 0, 0 );
insert into vector2 values( 4, 0, 0 );
insert into vector2 values( 5, 0, 0 );
insert into vector2 values( 6, 0, 0 );

insert into vectorset values( 7, 1, 2 ); insert into vectorset values( 8, 3, 4 );

doing so I get this error :

ORA-00060: deadlock detected while waiting for resource ORA-04088: error during execution of trigger

So here's two question :

  1. Does anyone know a way around that will enable me to delete the value from the vector2 table?
  2. I though that specifying 'pragma autonomous_transaction' into a procedure would put the statement into the queue and that they would be executed in another transaction, hence not getting a deadlock since the lock should be released by my trigger when the statement gets executed. Obviously, i'm missing something here... any help on that one ?

Thanks in advance

Hugues Landry ... a poor programmer that's trying to understand the relational way of life.

PS : i tried to post this yesterday but my message got lost :-( If two of those
appear in the group i'm really sorry about it ! Received on Mon Jan 21 2002 - 11:19:14 CST

Original text of this message

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