ITPub博客

首页 > 应用开发 > IT综合 > Row Share Table Locks (RS) (344)

Row Share Table Locks (RS) (344)

原创 IT综合 作者:tsinglee 时间:2007-12-11 11:34:27 0 删除 编辑

A row share table lock (also sometimes called a subshare
table lock, SS) indicates that the transaction holding the lock on the table has locked
rows in the table and intends to update them. A row share table lock is automatically
acquired for a table when one of the following SQL statements is run:

SELECT ... FROM table ... FOR UPDATE OF ... ;

LOCK TABLE table IN ROW SHARE MODE;

A row share table lock is the least restrictive mode of table lock, offering the highest
degree of concurrency for a table.

Permitted Operations: A row share table lock held by a transaction allows other
transactions to query, insert, update, delete, or lock rows concurrently in the same
table. Therefore, other transactions can obtain simultaneous row share, row exclusive,
share, and share row exclusive table locks for the same table.

Prohibited Operations: A row share table lock held by a transaction prevents other
transactions from exclusive write access to the same table using only the following
statement:
LOCK TABLE table IN EXCLUSIVE MODE;

行共享锁
1. 拥有此锁的事务已经锁定了表内的某些数据行,并打算对数据行进行更新操作
2. 行共享锁是限制程度最低的表级锁,因而能够保证表的最大的并发访问能力
3. 获得行共享锁允许的操作 : 其他事务依然可以查询 ,修改, 删除等
其他事务同时也能获得相同表上的行共享,行排他,共享, 及共享行排他模式的表级锁
4. 获得行共享锁后禁止的操作 : 禁止其他事务通过以下语句排他的对相同表进行写操作:
  LOCK TABLE table IN EXCLUSIVE MODE;

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-991290/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Table Locks (TM) (343)
请登录后发表评论 登录
全部评论
  • 博文量
    740
  • 访问量
    1897853