Share Table Locks (S) (346)

A share table lock is acquired automatically for the table specified
in the following statement:
LOCK TABLE table IN SHARE MODE;

Permitted Operations: A share table lock held by a transaction allows other transactions
only to query the table, to lock specific rows with SELECT ... FOR UPDATE, or to run
LOCK TABLE ... IN SHARE MODE statements successfully. No updates are allowed by
other transactions. Multiple transactions can hold share table locks for the same table
concurrently. In this case, no transaction can update the table (even if a transaction
holds row locks as the result of a SELECT statement with the FOR UPDATE clause).
Therefore, a transaction that has a share table lock can update the table only if no other
transactions also have a share table lock on the same table.

Prohibited Operations: A share table lock held by a transaction prevents other
transactions from modifying the same table and from executing the following
statements:
LOCK TABLE table IN SHARE ROW EXCLUSIVE MODE;
LOCK TABLE table IN EXCLUSIVE MODE;
LOCK TABLE table IN ROW EXCLUSIVE MODE;

共享表锁
1. 使用LOCK TABLE table IN SHARE MODE;语句可获得共享表锁
2. 获得共享表锁后允许的操作 : 只允许其他表进行操作 , 其他事务不能对表进行更新操作
3. 获得共享表锁后禁止的操作 : 除了不允许其他事务修改表外 , 也不允许执行下列语句
...

[@more@]

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

转载于:http://blog.itpub.net/10599713/viewspace-991293/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值