关于读取记录的问题

连接1:

SET TRANSACTION ISOLATION LEVEL READ COMMITTED
begin transaction
select top 4 * from admin_inputproducts with(updlock,readpast)  where istop=1
waitfor time '10:37'
commit

连接2:   //连接1读取到的记录连接2是不会读取的。

SET TRANSACTION ISOLATION LEVEL READ COMMITTED
begin transaction
select top 4 * from admin_inputproducts with(updlock,readpast)  where istop=1  //如果将updlock改为xlock会commit

//并发连接

SET TRANSACTION ISOLATION LEVEL READ COMMITTED
begin transaction
waitfor time '11:15'
select top 1 id from mm
with(xlock,readpast)  where istop=1
commit

连接2

SET TRANSACTION ISOLATION LEVEL READ COMMITTED
begin transaction
waitfor time '11:15'
select top 1 *  from mm
with(xlock,readpast)  where istop=1
commit
数据是不一样的

posted @ 2010-12-25 22:55  老高dotnet实践  阅读(198)  评论(0编辑  收藏  举报