Timeline for Strange SQL Server 2008 behavior while using XLOCK and ROWLOCK
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 19, 2019 at 17:03 | comment | added | Triynko | Make sure you have a "unique" index on RegionID, and make sure the row actually exists. Without a unique index, the right lock can't be taken. Nor can it be taken if the rows doesn't exist. For example, if you have a unique index on region id, and rows 1 and 3 exist, you can start two separate transactions, and if one locks 1 and the other locks 3, they can do that at the same time. Likewise, you can simultaneously lock one non-existing row, such as 4. However, if you try to lock another row that does not exist, such as 5, it will fail because of 4. | |
Dec 28, 2011 at 12:25 | history | migrated | from stackoverflow.com (revisions) | ||
May 31, 2011 at 7:18 | vote | accept | CommunityBot | ||
May 31, 2011 at 4:59 | answer | added | gbn | timeline score: 4 | |
May 31, 2011 at 4:21 | history | asked | DooDoo | CC BY-SA 3.0 |