|
-
Jun 11th, 2022, 03:04 AM
#8
Re: MSSQL Locks
In MSSQL can't remember another use-case where one would need to manually use lock hints besides UPDLOCK on a SELECTs to serialize access to certain rows so that multiple connections do not see "data in transit" while it's being processed and persisted by the (single) writer.
This is esp. needed with RCSI (read commited snapshot isolation) level where each connection literally has its own "copy of the world" and can see stale (old) data very easily from its snapshot of the world.
Using UPDLOCK hint is very useful for deadlock prevention too because it allows manually setting up the order base tables are locked for modification in a transaction. Out of order updates by multiple transactions is usually the root cause for deadlocks in any RDBMS.
cheers,
</wqw>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|