gpt4 book ai didi

c# - 使用 Nhibernate 获取表锁 (MyIsam)

转载 作者:行者123 更新时间:2023-11-29 14:47:22 25 4
gpt4 key购买 nike

使用 Nhibernate 如何获得“表锁”

我想做的是这样的:

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。

关于c# - 使用 Nhibernate 获取表锁 (MyIsam),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6647031/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com