Forum Stats

  • 3,853,608 Users
  • 2,264,246 Discussions
  • 7,905,416 Comments

Discussions

ORA-00060: deadlock detected while waiting for resource

634151
634151 Member Posts: 207
edited Sep 7, 2010 9:01AM in SQL & PL/SQL
Hi,

I have a trigger for one underlying table. It will fire after insert happened into that underlying table. When i try to update some columns in same underlying table within the trigger, i am getting the below error.

ORA-00060: deadlock detected while waiting for resource

Can anyone clear or correct me.

Thanks

Best Answer

  • Sven W.
    Sven W. Member Posts: 10,551 Gold Crown
    Answer ✓
    Ignore Thota. He's just a spammer that is trying to promote some criminal web site.

    A deadlock occures if two different sessions lock the same ressources. Each session will wait for the other session to finish.

    I guess you implemented a trigger and used the "autonomous transaction" feature wrongly to do a commit. This feature will create a new session. Now you have two (or more) session that might create the deadlock. Commiting inside a table trigger is ALWAYS wrong (with very few exceptions).

    Solution: remove the pragma from your trigger. Then solve the other issues that you get with it.

Answers

  • Sven W.
    Sven W. Member Posts: 10,551 Gold Crown
    Answer ✓
    Ignore Thota. He's just a spammer that is trying to promote some criminal web site.

    A deadlock occures if two different sessions lock the same ressources. Each session will wait for the other session to finish.

    I guess you implemented a trigger and used the "autonomous transaction" feature wrongly to do a commit. This feature will create a new session. Now you have two (or more) session that might create the deadlock. Commiting inside a table trigger is ALWAYS wrong (with very few exceptions).

    Solution: remove the pragma from your trigger. Then solve the other issues that you get with it.
This discussion has been closed.