mysql中的get_lock鎖機制解析

#####1. 先來看一看語法web select get_lock(key, timeout) from dual; select release_lock(key) from dual; #####2. 概述 (1)get_lock會按照key來加鎖,別的客戶端再以一樣的key加鎖時就加不了了,處於等待狀態。 (2)當調用release_lock來釋放上面加的鎖或客戶端斷線了,上面的鎖纔會釋放
相關文章
相關標籤/搜索