Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据我们的要求,我们select for update在获取数据时用锁锁定一个表。这样,没有其他线程获取该数据。
select for update
我只是想确认是否select count(*) from table where column1=value1会检索锁定的行。
select count(*) from table where column1=value1
如果是,它会检索在锁定结束时所做的最近更改select for update(即它会等待更新行)还是会显示陈旧的数据?
谢谢,
1. 这取决于 TX 隔离级别。
2. 锁定意味着stop and wait但不是skip。
stop and wait
skip