我需要对浏览量做两处更新,但我需要确保这些更新能够一起进行,而且从另一个用户那里没有任何其他查询可以干扰。 我知道<条码>。 通用名称代码>,但我想在第一次更新之后,这当然会锁定,这意味着有人会干扰第二次更新。 如果其他人首先更新这一行文,更新工作就会奏效,但将会更新数据。 是否有办法确保这两个最新情况如何? 我被告知交易情况,但只要我知道,这些交易对确保实际发生两次更新,而不是“再次”进行,除非我错了,而且各行将锁在交易之前?
这里的问题是:
www.un.org/spanish/ga UPDATE table SET x=x+2 WHERE x>z
www.un.org/spanish/ga WHERE y>z
I made a mistake and didn t give full information. That was my fault. I have updated the queries. The issue I have is that z can be updated as well. If z is updated after the SELECT but before the other two updates, the data can get messed up. Does doing the transaction BEGIN/COMMIT work for that?