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

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;
主站蜘蛛池模板: 安乡县| 略阳县| 微博| 屏山县| 凉城县| 石景山区| 浦北县| 高安市| 洮南市| 称多县| 盘锦市| 阜康市| 隆安县| 灌云县| 中超| 沈丘县| 临泉县| 石泉县| 连州市| 体育| 五常市| 柞水县| 蒙城县| 九寨沟县| 灌云县| 革吉县| 长子县| 兴隆县| 新巴尔虎左旗| 湘潭县| 怀集县| 华容县| 康定县| 永丰县| 安岳县| 大姚县| 稻城县| 慈溪市| 五原县| 集安市| 从化市|