乐观并发控制方法探讨

需积分: 10 2 下载量 101 浏览量 更新于2024-09-12 收藏 986KB PDF 举报
"《乐观并发控制方法》 本文探讨了数据库系统中的一种非锁定(non-blocking)并发控制策略,特别是在处理大量并发交易时,传统的数据对象锁定机制不再适用。作者们提出了两种乐观并发控制(Optimistic Concurrency Control, OCC)方法,它们的核心思想是"希望"在大多数情况下,事务之间的冲突不会发生,从而依赖于事务回滚作为主要的控制手段。 乐观并发控制方法的主要特点包括: 1. **信任度与期望失败处理**:乐观并发控制假设在大多数操作中,系统可以继续运行而不会遇到冲突。事务在执行过程中不会立即锁住资源,而是完成操作后再检查是否与其他事务的修改产生了冲突。如果发现冲突,才进行必要的调整或回滚。 2. **基于版本管理**:这些方法通常依赖于版本跟踪,每个数据对象都有一个当前版本,事务在访问前获取该版本。事务在更新对象时,只修改自己的副本,只有当提交时才发现可能存在的冲突,这时可能需要回滚到上一个版本或者与其他事务协调解决。 3. **适用场景**:乐观并发控制适合那些冲突概率较低的应用场景,例如读多写少的操作,因为在这种情况下,冲突的可能性相对较小,系统性能会优于频繁的锁争用。此外,它也适用于分布式系统,因为锁定全局数据可能带来网络延迟和复杂性。 4. **关键字与主题分类**:本文的关键字包括数据库、并发控制、事务处理。在数据库技术的分类中,这属于4.32(并发控制理论)和4.33(并发控制算法)。 1. **介绍**:文章开篇通过分析共享数据库系统的挑战,强调了如何在确保数据完整性的同时提供高效并发访问。引入事务的概念,即任何遵循数据约束序列的操作集合,以此为基础探讨乐观并发控制的实现方式和优势。 《乐观并发控制方法》是一篇深入研究了数据库并发控制领域的一种创新策略,它旨在通过减少锁定操作来提高系统性能,特别适用于那些冲突较少的场景。理解并应用这些方法对于设计高效的分布式系统和现代数据库架构至关重要。"
2016-11-18 上传
Key Features Learn how to use the new features of Entity Framework Core 1 Improve your queries by leveraging some of the advanced features Avoid common pitfalls Make the best of your .NET APIs by integrating with Entity Framework Book Description Entity Framework is a highly recommended Object Relation Mapping tool used to build complex systems. In order to survive in this growing market, the knowledge of a framework that helps provide easy access to databases, that is, Entity Framework has become a necessity. This book will provide .NET developers with this knowledge and guide them through working efficiently with data using Entity Framework Core. You will start off by learning how to efficiently use Entity Framework in practical situations. You will gain a deep understanding of mapping properties and find out how to handle validation in Entity Framework. The book will then explain how to work with transactions and stored procedures along with improving Entity Framework using query libraries. Moving on, you will learn to improve complex query scenarios and implement transaction and concurrency control. You will then be taught to improve and develop Entity Framework in complex business scenarios. With the concluding chapter on performance and scalability, this book will get you ready to use Entity Framework proficiently. What you will learn Master the technique of using sequence key generators Validate groups of entities that are to be saved / updated Improve MVC applications that cover applications developed using ASP.NET MVC Core 1 Retrieve database information (table, column names, and so on) for entities Discover optimistic concurrency control and pessimistic concurrency control. Implement Multilatency on the data side of things. Enhance the performance and/or scalability of Entity Framework Core Explore and overcome the pitfalls of Entity Framework Core About the Author Ricardo Peres is a Portuguese developer, blogger, and occasionally an e-book author. He has more than 17 years of experience in software development, using technologies such as C/C++, Java, JavaScript, and .NET. His interests include distributed systems, architectures, design patterns, and general .NET development. He currently works for London-based Simplifydigital as a technical evangelist, and was first awarded as MVP in 2015. Ricardo maintains a blog, Development With A Dot, where he regularly writes about technical issues. You can read it here: http://weblogs.asp.net/ricardoperes. He has reviewed Learning NHibernate 4 for Packt. You can catch up with him at @RJPeres75. Table of Contents Chapter 1. Improving Entity Framework in the Real World Chapter 2. Mapping Entities Chapter 3. Validation and Changes Chapter 4. Transactions and Concurrency Control Chapter 5. Querying Chapter 6. Advanced Scenarios Chapter 7. Performance and Scalability Appendix A. Pitfalls
2016-11-13 上传
Entity Framework Core Cookbook - Second Edition by Ricardo Peres English | 9 Nov. 2016 | ISBN: 1785883305 | 340 Pages | MOBI/EPUB/PDF+Code Files | 6.2 MB Entity Framework is a highly recommended Object Relation Mapping tool used to build complex systems. In order to survive in this growing market, the knowledge of a framework that helps provide easy access to databases, that is, Entity Framework has become a necessity. This book will provide .NET developers with this knowledge and guide them through working efficiently with data using Entity Framework Core. Key Features Learn how to use the new features of Entity Framework Core 1 Improve your queries by leveraging some of the advanced features Avoid common pitfalls Make the best of your .NET APIs by integrating with Entity Framework Book Description You will start off by learning how to efficiently use Entity Framework in practical situations. You will gain a deep understanding of mapping properties and find out how to handle validation in Entity Framework. The book will then explain how to work with transactions and stored procedures along with improving Entity Framework using query libraries. Moving on, you will learn to improve complex query scenarios and implement transaction and concurrency control. You will then be taught to improve and develop Entity Framework in complex business scenarios. With the concluding chapter on performance and scalability, this book will get you ready to use Entity Framework proficiently. What you will learn Master the technique of using sequence key generators Validate groups of entities that are to be saved / updated Improve MVC applications that cover applications developed using ASP.NET MVC Core 1 Retrieve database information (table, column names, and so on) for entities Discover optimistic concurrency control and pessimistic concurrency control. Implement Multilatency on the data side of things. Enhance the performance and/or scalability of Entity Framework Core Explore