使用Nhibernate如何获得“TABLE LOCKS”
我想做的是这样的事情:
TABLE LOCKS table1;
update counter= 1 + counter from table1 where id=1;
select counter from table1 where id=1;
UNLOCK TABLES;
答案 0 :(得分:1)
在查询之前运行此功能:
var command = session.Connection.CreateCommand();
command.CommandText = "TABLE LOCKS table1";
command.ExecuteNonQuery();
之后相应的UNLOCK。