The holdlock table hint in SQL
server is used to maintain locks on specified table until the end of the
transaction. It effectively applies the serializable isolation level to the
table , ensuring that the data we read remains consistent and unchanged by the
other transaction during our transaction.
This hint is particularly useful
when we need strong data consistency and want to prevent other transaction from
modifying the data we are working with. It can significantly increase blocking
other transaction are prevented from accessing the locked row.
This hint prevent the Fantom read. It can cause deadlock if we used incorrectly.
No comments:
Post a Comment
If you have any doubt, please let me know.