473,320 Members | 1,933 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,320 software developers and data experts.

update deadlock question

hi can anyone tell me if the order of the update staments on multiple
tables can have an effect on deadlocks on a transactions.
for examples if i have a

dog -> dogid colorid breedid name
color-> colorid color
breed-> breedid breed
would it make any difference if i update the breed table before
updating the dog table?
thanks
Jul 20 '05 #1
3 1161
Joseph (jc*****@hotmail.com) writes:
hi can anyone tell me if the order of the update staments on multiple
tables can have an effect on deadlocks on a transactions.
for examples if i have a

dog -> dogid colorid breedid name
color-> colorid color
breed-> breedid breed
would it make any difference if i update the breed table before
updating the dog table?


Yes, the order of the update statement has importance, as far that if
different processes updates tables in different order, the risks for
a deadlock increases.

I'm afraid that I don't understand your example, so I cannot comment
on it particularly.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
thank for your tips, i believe the answer to my question is that if
several tables are update by 2 transactions the tables should be
updated in the same order if posible.
Jul 20 '05 #3
Joseph (jc*****@hotmail.com) writes:
thank for your tips, i believe the answer to my question is that if
several tables are update by 2 transactions the tables should be
updated in the same order if posible.


Yes, this is a common entry on lists "How to avoid deadlocks". To be
more precise, this lists even say "Access tables in the same order".
It is however a rule which is almost impossible to adhere to in a complex
system with many different flows of logic.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4

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

Similar topics

7
by: Duncan Grisby | last post by:
Hi, Does anyone know of a deadlock detector for Python? I don't think it would be too hard to hook into the threading module and instrument mutexes so they can be tested for deadlocks. I've...
5
by: jayson_13 | last post by:
Hi, I need to implement a counter and i face problem of locking so hope that u guys can help me. I try to do test like this : 1st connection SELECT * FROM nextkey WHERE tblname = 'PLCN'...
0
by: steven | last post by:
In both mysql version 4.0.16 and 4.1.8 I'm running into deadlock behavior that I don't understand: can anyone explain why the following happens? Heres a basic table definition that exhibits the...
6
by: Todd McNeill | last post by:
Hi- We ran into some very strange deadlocks this AM, and I was hoping to get some insight. We were running a REORGCHK on a database, and started getting deadlocks. What is curious is that...
3
by: Ray | last post by:
I am having my first experience using BLOB as a row in a table. I am using it to insert graphics for labels we print. I have no problem inserting into and select from the table. The graphic is...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
4
by: fmatamoros | last post by:
I sometimes get the following error from an update statement in a stored procedure: Transaction (Process ID 62) was deadlocked on thread | communication buffer resources with another process and...
4
by: pike | last post by:
DB2 UDB 8.1 FP7 We are getting intermittent deadlocks (911 RC 2) even when U row-lock has been secured. The transaction is as follows: 1) Select current application number value from table....
1
by: djpeg | last post by:
Hi, I have query something like this: select * from emp where sal > ( select avg(sal) from emp ) for update When ran multithreaded environment, i used to get this error "Abnormal end unit of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.