【发布时间】:2013-04-25 17:24:01
【问题描述】:
我有交易范围,我想:
using (var scope = new TransactionScope())
{
1) Insert row into table1
2) Select rows from table1 (incuding inserted row in step 1)
3) Insert another row into table1
4) Select rows from table1 (incuding inserted row in step 1 and 3)
}
有没有机会在这些操作中出现 sql 死锁?我正在使用 Db 工作的实体框架。我不确定。
谢谢,
祝你有美好的一天。
【问题讨论】:
-
你的意思是'这个例程是否有可能自己生成一个sql死锁',即没有任何其他人访问数据库?还是您的意思是“如果两个(或更多)用户同时运行此例程,是否可能发生 sql 死锁”?
-
本身就是一个平均死锁。
标签: sql sql-server entity-framework tsql