Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 (中文) » SQL Anywhere 服务器 - SQL 用法 » 事务和隔离级别 » 锁定的工作方式

 

表锁

除了支持行锁,SQL Anywhere 还支持表锁。表锁不同于模式锁:表锁在表的所有行上放置锁,而模式锁在表的模式上放置锁。有三类表锁:共享表锁、意图写表锁和独占表锁。

事务结束(发生 COMMIT 或 ROLLBACK)后释放表锁。

下表显示了哪两个表锁之间会发生冲突:

Shared Intent Exclusive
Shared 冲突 冲突
Intent 冲突 冲突
Exclusive 冲突 冲突 冲突
 共享表锁
 意图写表锁
 独占表锁
 另请参见