1. DML LOCK
2. DDL LOCK
3. INTERNAL
Sql allowed to lock lock
0 select * from tab; RS RX S SRX X
1 row share (RS) select * from tab for insert RS RX S SRX
lock tab xx in row share mode; prohibit X, while prohibiting the default RX, update tab
2 row exclusive (RX) insert into tab ; RS RX
lock tab xx in row exclusive mode; X S SRX prohibited if another default RX, RS as the lock prohibits
3 share ( S) lock tab xx in share mode; RS S
Prohibit other users insert, only query
4 share row exclusive (SRX) lock tab xx in share row exclusive mode RS
X S SRX RX prohibition
5 exclusive ( X ) lock tab xx in exclusive mode 无
The strongest restrictions, does not allow insert and locking tab, only the query