Serialization and Key-Range Locking

As mentioned in the previous section, SQL Server provides serialization (Isolation Level 3) through the SET TRANSACTION ISOLATION SERIALIZABLE command. One of the isolations provided by this isolation level is the prevention against phantom reads. Preventing phantom reads means that the recordset that a query obtains within a transaction must return the same result set when it is run multiple times within the same transaction. That is, while a transaction is active, another transaction should not be allowed to insert new rows that would appear in the recordset of a query that were not in the original recordset retrieved by the transaction. SQL Server provides this capability though key-range locking.

As described ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.