deadlock situation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amoldiego
    New Member
    • Jun 2007
    • 28

    deadlock situation

    Hi,
    I am updating same row of the Same Table in 2 diff session, i.e, for deadlock situation

    In 1st session

    declare
    a number(5) := 123;
    begin
    update ba_bank_mast set COD_BANK=a;
    end;
    /

    In 2nd Session

    declare
    a number(5) := 456;
    Deadlock_detect ed Exception;
    Pragma Exception_init( Deadlock_detect ed, -60);
    begin
    update ba_bank_mast set COD_BANK=a;
    Exception
    When Deadlock_detect ed then
    dbms_output.put _line('DeadLOck Detected');
    end;
    /

    i.e, I wanted to handle this deadlock in Exception Handler Section. But Whenever
    I fire this in 2nd session, session hangs.
    So What Others parameters to be checked or change in PL code.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    in the code of second session as u try to execute the update part the session will get hanged becasue of deadlock situation.

    so the control will not go inside the EXCEPTION block.
    and the second session code will never execute fully.

    Comment

    Working...