ITPub博客

首页 > 应用开发 > IT综合 > Row-Level Locking (323)

Row-Level Locking (323)

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

Both read committed and serializable transactions use row-level locking, and both will
wait if they try to change a row updated by an uncommitted concurrent transaction.
The second transaction that tries to update a given row waits for the other transaction
to commit or undo and release its lock. If that other transaction rolls back, the waiting
transaction, regardless of its isolation mode, can proceed to change the previously
locked row as if the other transaction had not existed.

However, if the other blocking transaction commits and releases its locks, a read
committed transaction proceeds with its intended update. A serializable transaction,
however, fails with the error Cannot serialize access error, because the other
transaction has committed a change that was made since the serializable transaction
began.

行级锁
1. 已提交读取与串行化都采用行级锁技术 , 他们在更新未提交的并发事务修改的数据行时
都会发生等待 , 等待未提交的并发事务提交或撤销,释放锁 . 如果其他的事务回滚 ,
两者都都能修改之前被锁住的数据行,如同未提交的并发事务不存在一样
2. 当导致阻塞的事务交并释放了锁后 , 已提交读写模式下的等待事务就能够继续执行其中的更新
操作 , 而在串行化模式下的等待事务将出现无法进行串行化访问的错误

[@more@]

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

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