Handling deadlocks

Posts   
 
    
Posts: 87
Joined: 17-May-2011
# Posted on: 03-Apr-2013 16:55:24   

Hi there,

Is there any built method or strategy offered by LLBLGen Pro for handlig deadlocks on tables, As we are getting dead locks many times while retrieving data, for further information we are using self-service mode.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 03-Apr-2013 19:13:48   

Nope.

That's a pure design issue.

My 2 cents: You should profile your database to put your hands on the queries that causes the dead locks. And then you should redesign your software to change the sequence of these calls, or safeguarding critical sections of your code against dead locks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 04-Apr-2013 09:28:06   

Indeed, profiling is a good start. Then, go back to where selects are issued and check a couple of things: - table scans instead of index reads are a first sign a deadlock will occur there. Add indexes to avoid table scans - selects in code which starts transactions should be moved to a point before the transaction is started, or the elements participating in the select should be added to the transaction. If you don't do that, a new connection is started, which will hang on locks set by inserts/updates in a transaction which is also currently going on.

Frans Bouma | Lead developer LLBLGen Pro