Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
行锁可确保在某个事务完成(通过发出隐式或显式 COMMIT 语句提交更改,或通过 ROLLBACK 语句中止更改)前,由该事务修改的任何行无法被其它事务修改,因此,行锁可用于防止更新丢失以及其它类型的事务不一致。
有三类行锁:读(共享)锁定、写(独占)锁定以及意图锁。数据库服务器会为每个事务自动获取这些锁。
读锁定写锁定意图锁