473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Are Deadlocks inevitable ?

There are many references to deadlock handlers that retry the
transaction automatically.

But IMO a deadlock is the result of a design flaw that should be
fixed.

My applications treat deadlocks like any other runtime error - they
are logged and fixed.

There seems to be a an opinion that deadlocks are inevitable !

This is not true - any scenario resulting in a deadlock can be cured
by adjusting the application.

I have talked with database consultants working for banks that think
deadlocks are an acceptable every day occurrence.

Now that is scary ...

Jul 10 '08 #1
4 4180
John Rivers wrote:
There are many references to deadlock handlers that retry the
transaction automatically.

But IMO a deadlock is the result of a design flaw that should be
fixed.

My applications treat deadlocks like any other runtime error - they
are logged and fixed.

There seems to be a an opinion that deadlocks are inevitable !

This is not true - any scenario resulting in a deadlock can be cured
by adjusting the application.
I wouldn't go as far as claiming "any".
I have talked with database consultants working for banks that think
deadlocks are an acceptable every day occurrence.
If you have a complex transaction with many concurrent users I think I
agree that deadlocks are inevitable.
You cannot realistically sort data access/change in a way to always
guarantee lock waits over deadlocks at a reasonable expense.
So fault toleration is the more sensible way.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jul 10 '08 #2
Serge Rielau wrote:
John Rivers wrote:
>There are many references to deadlock handlers that retry the
transaction automatically.

But IMO a deadlock is the result of a design flaw that should be
fixed.

My applications treat deadlocks like any other runtime error - they
are logged and fixed.

There seems to be a an opinion that deadlocks are inevitable !

This is not true - any scenario resulting in a deadlock can be cured
by adjusting the application.
I wouldn't go as far as claiming "any".
>I have talked with database consultants working for banks that think
deadlocks are an acceptable every day occurrence.

If you have a complex transaction with many concurrent users I think I
I meant complex _application_ ...

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jul 10 '08 #3

An interesting idea:

to swap a deadlock-proof design for a higher performing design that
suffers deadlocks

but by accepting deadlocks you risk one client being selected as the
deadlock victim repeatedly for a long period of time ... potentially
forever!

Jul 10 '08 #4
John Rivers (fi*****@btinternet.com) writes:
but by accepting deadlocks you risk one client being selected as the
deadlock victim repeatedly for a long period of time ... potentially
forever!
If you have that high deadlock frequency, you better do something about it.

It is possible that every deadlock that occurs in an application could be
address. But what would the cost be? And what would the risk be that you
introduce bugs or performance bottlenecks.

If you have a bunch of background processes that deadlocks with each
other, or at least willing to become the deadlock victim, then some 20-30
deadlocks per day is not a big issue. It becomes an issue, if users get
this message slapped in the face 20-30 times a day, or if you have deadlocks
every minute. Then again, if you have deadlocks every minute, the deadlocks
are likely to be a symptom of a general performance problem.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jul 10 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AKS | last post by:
I am getting lot of deadlocks in my application. As it is very complex ti avoid deadlocks at this stage of application we have done few steps to lessen the impact. We have added retries after...
3
by: Hasan | last post by:
Hi I'm having a problem with deadlocks in a table in SQL server when trying to update it through Biztalk 2004. There is no problem when I use the same Biztalk solution to update a similar dummy...
1
by: Matt White | last post by:
We've found deadlocks in the trace file that were not captured by our Powerbuilder application. Some deadlocks are trapped or, at least, reported to the user as a db error, and others are...
4
by: T Dubya | last post by:
We're experiencing a large number of deadlocks since we began running SQL Server 2000 Enterprise Edition SP3 on a Dell 6650 with hyper threading intel processors. We don't have the same problem on...
7
by: Marcus | last post by:
Hello all, I am trying to figure out when it is appropriate to use shared and exclusive locks with InnoDB. Using shared locks (lock in share mode), I can easily create a scenario with 2 clients...
9
by: Mike Carr | last post by:
I am running into an issue. Recently I installed IBuySpy Portal and then converted the data source to odp.net. When debugging the app my machine would freeze or become really slow. I can reproduce...
6
by: Greg Stark | last post by:
There's another poster complaining about referential integrity checks causing deadlocks. Unfortunately I've deleted the message so this response (and the archives aren't responding) isn't going to...
0
by: PeterC | last post by:
We're getting numerous deadlocks in a multi-user system where users are coming in and updating their own data. In our troubleshooting/traces, the deadlocks seem to be coming from lock contention...
3
by: bobdurie | last post by:
Hi, We have a Java application that runs against a variety of backends including Oracle and MSSql 2000 and 2005. Our application has a handful of active tables that are constantly being...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.