知识卡片
两阶段锁约束加锁顺序
扩张阶段可以继续取得锁,收缩阶段只能归还已有锁;一旦归还第一个锁,就不能再申请新锁。锁的获取和释放约束为并发事务建立一致的串行顺序。保守 2PL 在执行前要拿齐锁,可能损失并发。2PL 作用于资源访问,分布式两阶段提交作用于提交决定。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 5. Transaction Processing and Recovery Lock-Based Concurrency Control · 查看原书依据
A rule that follows from these two definitions is that a transaction cannot acquire any locks as soon as it has released at least one of them.
参考来源
- 位置:《Database Internals》Chapter 5. Transaction Processing and Recovery(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch05.html#lock_based_cc,段 198)
- 结论依据:第 195–205 段区分两个加锁阶段、保守变体与 2PC。
- 原始内容:A rule that follows from these two definitions is that a transaction cannot acquire any locks as soon as it has released at least one of them.