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

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;
主站蜘蛛池模板: 蒙城县| 新巴尔虎右旗| 姚安县| 原阳县| 佛坪县| 长子县| 于田县| 清新县| 泰州市| 时尚| 施甸县| 贺州市| 鹤山市| 公主岭市| 山阴县| 乐平市| 嘉鱼县| 印江| 高台县| 防城港市| 营口市| 重庆市| 文登市| 商都县| 阿坝县| 平乡县| 南宫市| 南昌市| 安溪县| 定陶县| 惠安县| 淳安县| 马鞍山市| 富阳市| 石景山区| 理塘县| 新丰县| 通山县| 舞阳县| 庐江县| 龙泉市|