官术网_书友最值得收藏!

NOWAIT and SKIP LOCKED

When rows are locked by other transactions that you are trying to access, then you need to wait for that transaction to release the lock on the same row so that you can access it accordingly. To avoid waiting for the other transaction, InnoDB has added support of the NOWAIT and SKIP LOCKED options. NOWAIT will return immediately with an error in case the requested row is locked rather than going into the waiting mode, and SKIP LOCKED will skip the locked row and never wait to acquire the row lock. Hence, SKIP LOCKED will not consider the locked row in the resulting set:

SELECT * FROM table1 WHERE id = 5 FOR UPDATE NOWAIT;
SELECT * FROM table1 FOR UPDATE SKIP LOCKED;
主站蜘蛛池模板: 南阳市| 将乐县| 合水县| 延川县| 金山区| 农安县| 惠安县| 灵丘县| 三都| 南安市| 阜康市| 维西| 丹寨县| 通辽市| 镇巴县| 淮北市| 石首市| 岗巴县| 曲周县| 东平县| 苍梧县| 洛宁县| 太原市| 崇明县| 满城县| 柳州市| 阳春市| 肇东市| 凭祥市| 芷江| 太仓市| 宁河县| 澄城县| 新晃| 珠海市| 山丹县| 新宁县| 民县| 虞城县| 沙湾县| 平湖市|