0
使用NHibernate我如何能得到“表锁”获取表锁使用NHibernate
我希望做的是somwthing像这样(的MyISAM):
TABLE LOCKS table1;
update counter= 1 + counter from table1 where id=1;
select counter from table1 where id=1;
UNLOCK TABLES;
使用NHibernate我如何能得到“表锁”获取表锁使用NHibernate
我希望做的是somwthing像这样(的MyISAM):
TABLE LOCKS table1;
update counter= 1 + counter from table1 where id=1;
select counter from table1 where id=1;
UNLOCK TABLES;
查询之前只要运行这个:
var command = session.Connection.CreateCommand();
command.CommandText = "TABLE LOCKS table1";
command.ExecuteNonQuery();
然后相应的UNLOCK。
谢谢!最后我用什么: command.CommandText =“LOCK TABLES table1 WRITE”; – dimirc
哎呀,对不起,看起来像MyIsam不支持交易。删除了我的答案。 – Davita