Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
X-Factor
Constraint Violating Yak Guru
392 Posts |
Posted - 2008-04-05 : 21:11:12
|
Hi,Lets say I have table A and table B and another table AB where each row in AB refereces a row in A and a row in B. Furthermore, I set both relationships to cascade upon delete.Then one user deletes a row from A which cascades to two rows in AB. But another user has deleted a row in B which is also trying to delete the same two rows in AB. The first transaction deletes one of the AB rows, the second deletes the other and then both transactions cannot get the other row in AB to delete because its locked. So this is a deadlock! Is it really that easy to get a dead lock?Cheers, XF. |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-04-05 : 21:30:43
|
if i understood you correctly yes and yes. you're getting deadlocks due to lock escalation from key to page lock._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
|
|
|
|
|