ITPub博客

首页 > 应用开发 > IT综合 > Share Row Exclusive Table Locks (SRX) (347)

Share Row Exclusive Table Locks (SRX) (347)

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

A share row exclusive table lock (also sometimes
called a share-subexclusive table lock, SSX) is more restrictive than a share table lock.
A share row exclusive table lock is acquired for a table as follows:
LOCK TABLE table IN SHARE ROW EXCLUSIVE MODE;

Permitted Operations: Only one transaction at a time can acquire a share row exclusive
table lock on a given table. A share row exclusive table lock held by a transaction
allows other transactions to query or lock specific rows using SELECT with the FOR
UPDATE clause, but not to update the table.

Prohibited Operations: A share row exclusive table lock held by a transaction prevents
other transactions from obtaining row exclusive table locks and modifying the same
table. A share row exclusive table lock also prohibits other transactions from obtaining
share, share row exclusive, and exclusive table locks, which prevents other
transactions from executing the following statements:
LOCK TABLE table IN SHARE MODE;
LOCK TABLE table IN SHARE ROW EXCLUSIVE MODE;
LOCK TABLE table IN ROW EXCLUSIVE MODE;
LOCK TABLE table IN EXCLUSIVE MODE;

共享行排他表锁
1. 比共享表锁的限制程度更高
2. 获得共享行排他表锁后允许的操作
: 同一时间内在一个表上只能有一个事务能获得共享行排他锁,
允许其他事务查询或者通过select ... for update语句来锁定特定的行 , 但不能更新他们
3. 获得共享行排他表锁后禁止的操作 : 一个事务获得该锁后 ,其他事务便不能或得该锁 ,
也不能对表
进行修改操作 ,其他事务也不能获得共享, 共享行排他 ,排他表锁 , 也不允许执行下列语句
...

[@more@]

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

请登录后发表评论 登录
全部评论
  • 博文量
    740
  • 访问量
    1897945