Results 1 to 4 of 4

Thread: Ora-00060

  1. #1
    Join Date
    Oct 2004
    Posts
    7

    Unanswered: Ora-00060

    Hi,

    I have a problem of concurrence in a table

    I'm executing some processes that makes sql to a Oracle table (table1), is a sql like this:

    select * from table1 where .... for update

    I uses 'for update' clause in order to lock the table while processing the sql, because sometimes two processes makes the sql to the same table at the same time. I hope that with 'for update' clause the processes1 makes the sql, processes2 keeps waiting for resource until processes1 finish (the sql normally last about 5-10 seconds), and when processes1 finish then processes2 run the sql.

    But, sometimes I get this error:

    ORA-00060: deadlock detected while waiting for resource

    I don't understand what's happennig. I think that there is a problem waiting for resorce, but ....why???, is there any solution???

    Any advice will be greatly apreciatted. Thanks

    Nauj

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    you can specify how long you want the waiting process to wait.

    Are you select only one row or a group of rows from your where clause?
    Why is the update taking 10-15 seconds?
    Perhaps you should tune the update procedures. Indexes, etc?
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Read this Orafaq text about a deadlock and how it can be fixed.

  4. #4
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    Hi,

    can I lock a (single) row for update ... ie, will I be waiting on anyone else?...

    Code:
    function CanIlockRock( ipk) is
       select col_pk
       into temp
       from table
       where table.pk = ipk
       for update nowait;
       return 'yes'
    exception when others then
       return 'no you cant'
    end;
    
    if CanILock( some_parent_row ) = 'yes' then
       update parent_row... (and usually all children)
    else
       user.say_sternly('not now darling, got a headache');
    end;
    Hth
    Bill
    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •