开发者

Getting Table Lock (MyIsam) using Nhibernate

开发者 https://www.devze.com 2023-03-19 02:32 出处:网络
Using Nhibernat开发者_高级运维e how can I get \"TABLE LOCKS\" What I\'d like to do is somwthing like this:

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

精彩评论

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