开发者

Getting Table Lock (MyIsam) using Nhibernate

Using Nhibernat开发者_高级运维e how can I get "TABLE LOCKS"

What I'd like to do is somwthing like this:

TABLE LOCKS table1;
update counter= 1 + counter from table1 where id=1;
select counter from table1 where id=1;
UNLOCK TABLES;


Just run this before your query:

var command = session.Connection.CreateCommand();
command.CommandText = "TABLE LOCKS table1";
command.ExecuteNonQuery();

And the corresponding UNLOCK afterwards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜