How come a page can be both intent share(IS) and intent exslusive(IX)

五迷三道 提交于 2019-12-11 06:16:00

问题


I'm new to TSQL, still struggling in understanding some basic concepts:

My textbook provides an example: there three session(3 query windows, I will refer to them as Connection 1, Connection 2, and Connection 3)

Run the following code in Connection 1 to update a row in the Production.Products table, adding 1.00 to the current unit price of 19.00 for product 2.

BEGIN TRAN;
 UPDATE Production.Products
 SET unitprice += 1.00
 WHERE productid = 2;

Run the following code in Connection 2 to try to query the same row

SELECT productid, unitprice
FROM Production.Products 
WHERE productid = 2;

query the dynamic management view (DMV) sys.dm_tran_locks in Connection 3.

SELECT -- use * to explore other available attributes
 request_session_id AS spid,
 resource_type AS restype,
 resource_database_id AS dbid,
 DB_NAME(resource_database_id) AS dbname,
 resource_description AS res,
 resource_associated_entity_id AS resid,
 request_mode AS mode,
 request_status AS status
FROM sys.dm_tran_locks;

and I gets an output:

we can see that spid 53( second query window) is blocked and wait for spid 52( firstquery window) to release the lock. But I don't understand why the page (720...440) can have both intent share(IS) and intent exslusive(IX)? what does it mean?

来源:https://stackoverflow.com/questions/56107566/how-come-a-page-can-be-both-intent-shareis-and-intent-exslusiveix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!