How to resolve deadlock permanently ?



Get solution for your ABEND Codes & System Error Messages, SQL Codes, File Status etc...

How to resolve deadlock permanently ?

Postby teju » Fri Mar 06, 2009 12:54 am

Hi

Can any tell me how to resolve deadlock permanently ?

Thnx
teju
 
Posts: 27
Joined: Fri Feb 27, 2009 6:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to resolve deadlock permanently ?

Postby dick scherrer » Fri Mar 06, 2009 1:58 am

Hello,

Change the order in which the rows are locked.

Right now you have some code that locks some tableA row(s), then some tableB row(s). While that is running, another process locks some tableB row(s), then some tableA row(s). When they are trying to lock the same rows, the deadlock occurs.

If all of the code is designed to lock tableA rows, then TableB rows, the deadlock will not happen. This sometimes means locking a row before it is actually needed by the code.

If there is reluctance to change the code, it becomes a scheduling problem. The tasks that deadlock should not be run concurrently.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to resolve deadlock permanently ?

Postby teju » Fri Mar 06, 2009 5:26 am

Can u tell me about negative dependency? how it is related in resolving deadlocks
teju
 
Posts: 27
Joined: Fri Feb 27, 2009 6:48 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to resolve deadlock permanently ?

Postby dick scherrer » Fri Mar 06, 2009 5:57 am

Hello,

Negative dependency is a scheduling term, rather than a database term (at least the one i'm familiar with :) ).

This could help with deadlocks as the confilcting tasks could be defined to the scheduling software such that neither would be submitted while the other was executing. It is a more formal term than
The tasks that deadlock should not be run concurrently.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to ABENDS & SQL Codes

 


  • Related topics
    Replies
    Views
    Last post