Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Autonomous Transaction -Dead lock

vijaypMay 10 2010 — edited May 10 2010
HI Guys ,
I was Reading about Autonomous Transaction from this link  http://www.orafaq.com/node/1915.
I got doubt in the following code .How the dead lock happened .

Procedure p2 is independent and committed ,so what is the reason for the deadlock here .
can any one me explain me why it went it deadlock situation




create table t4 (a number)
/

insert into t4 values (1)
/

commit
/

create or replace
procedure p2
as
   pragma autonomous_transaction;
begin
   update t4 set a = 2;
   commit;
end;
/
show errors

create or replace
procedure p1
as
begin
   update t4 set a = 3;
   p2;
   commit;
end;
/
show errors

exec p1

SQL> exec p1
BEGIN p1; END;

*
ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource
ORA-06512: at "KEVIN.P2", line 5
ORA-06512: at "KEVIN.P1", line 5
ORA-06512: at line 1
Thanks
vijay

Edited by: vijay539 on May 10, 2010 12:05 PM

Edited by: vijay539 on May 10, 2010 12:06 PM
This post has been answered by thomaso on May 10 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2010
Added on May 10 2010
5 comments
2,777 views