行級(jí)鎖
可以用select * from table where aa=bb for update;
表級(jí)鎖
lock table table_name
需要注意的是select * ..for update 會(huì)對(duì)所有返回的行加鎖。單其他記錄是可以只查詢(xún)這些行的。
所以 要想起到真真加鎖機(jī)制,做操作時(shí)select都要 加上for update
行級(jí)鎖
可以用select * from table where aa=bb for update;
表級(jí)鎖
lock table table_name
需要注意的是select * ..for update 會(huì)對(duì)所有返回的行加鎖。單其他記錄是可以只查詢(xún)這些行的。
所以 要想起到真真加鎖機(jī)制,做操作時(shí)select都要 加上for update
只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。 | ||
![]() |
||
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問(wèn)
管理
|
||
相關(guān)文章:
|
||