CMU SSD7: Database Systems. Lu Wei School of Software Northwestern Polytechnical University. 4.1 事务管理. 数据库系统两个核心概念: 数据抽象 事务支持 事务特性和事务保证. 4.1.1 事务支持. A transaction is the execution of a program segment that performs some function or task by accessing a shared database.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
4.1 事务管理 数据库系统两个核心概念: • 数据抽象 • 事务支持 事务特性和事务保证 Lu Wei
4.1.1事务支持 A transaction is the execution of a program segment that performs some function or task by accessing a shared database. A transaction is a logical unit of work on the database • deposit, withdraw, or transfer money • reserve a seat on a flight • reserve a room in a hotel Lu Wei
事务属性 ACID属性 As data models support data abstraction, transactions can be thought of similarly as supporting activity abstraction. Transactions provide application programmers with a high-level execution interface that hides both the effects of concurrency among the different transactions, and the presence of failures. How to do this? Lu Wei
原子性(Atomicity) Atomicity requires that either "all or none" of the transaction's operations be performed. Thus, all the operations of a transaction are treated as a single, indivisible, atomic unit. 由DBMS的恢复子系统保证。 Lu Wei
一致性(Consistency) Consistency requires that a transaction maintain the integrity constraints on the database. Thus, transactions are assumed to be correct and are treated as the unit of consistency. 由DBMS和应用程序开发者共同保证 Lu Wei
隔离性(Isolation) Isolation requires that a transaction execute without any interference from other concurrent transactions. That is, transactions are assumed to be independent. 由DBMS的并发控制子系统保证 Lu Wei
持久性(Durability) Durability requires that all the changes made by a committed transaction become permanent in the database, surviving any subsequent failures. 由DBMS的恢复子系统保证。 Lu Wei
A DBMS supports the ACID properties of transactions by implementing three different sets of algorithms. The first set, referred to as concurrency control protocols, ensures the isolation property; the second set, referred to as recovery protocols, ensures atomicity and durability properties; and the last set, referred to as triggering mechanisms, enforces the integrity constraints on a database. Lu Wei
严格两段锁协议(Strict 2PL protocol) Sttict 2PL is one in which transactions request locks just before they operate on a data item and their growing phase ends just before they are committed. 严格两段锁协议将事务以他们提交的顺序串行化。 次严格2PL:互斥锁直到事务结束才被释放 Lu Wei
死锁 两段锁协议下的一个重要问题是死锁。 死锁:当两个或多个事务相互等待对方所拥有的锁被释放时,所产生的僵持局面。 Lu Wei