PowerPoint Presentation1 Introduction to Transaction Processing (1)Introduction to Transaction Processing (2)Introduction to Transaction Processing (3)Introduction to Transaction Processing (4)Introduction to Transaction Processing (5)Two Sample TransactionsIntroduction to Transaction Processing (6)Concurrent execution is uncontrolled: (a) The lost update problem.Concurrent execution is uncontrolled: (b) The temporary update problem.Concurrent execution is uncontrolled: (c) The incorrect summary problem.Introduction to Transaction Processing (12)Introduction to Transaction Processing (13)Introduction to Transaction Processing (14)2 Transaction and System Concepts (1)Transaction and System Concepts (2)Transaction and System Concepts (3)Transaction and System Concepts (4)State Transition Diagram Illustrating the States for Transaction ExecutionTransaction and System Concepts (6)Transaction and System Concepts (7)Transaction and System Concepts (8)Transaction and System Concepts (9)Transaction and System Concepts (10)Transaction and System Concepts (11)3 Desirable Properties of Transactions (1)4 Characterizing Schedules Based on Recoverability (1)Characterizing Schedules Based on Recoverability (2)Characterizing Schedules Based on Recoverability (3)5 Characterizing Schedules Based on Serializability (1)Characterizing Schedules Based on Serializability (2)Characterizing Schedules Based on Serializability (3)Characterizing Schedules Based on Serializability (4)Characterizing Schedules Based on Serializability (5)Slide 35Characterizing Schedules Based on Serializability (7)Characterizing Schedules Based on Serializability (8)Characterizing Schedules Based on Serializability (9)Characterizing Schedules Based on Serializability (10)Characterizing Schedules Based on Serializability (11)Constructing the Precedence GraphsAnother Example of Serializability TestingSlide 43Slide 44Characterizing Schedules Based on Serializability (14)Characterizing Schedules Based on Serializability (15)6 Transaction Support in SQL2 (1)Transaction Support in SQL2 (2)Transaction Support in SQL2 (3)Transaction Support in SQL2 (4)Transaction Support in SQL2 (5)Transaction Support in SQL2 (6)Transaction Support in SQL2 (7)SummaryCopyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-WesleyChapter 21Introduction to Transaction Processing Concepts and TheoryCopyright © 2011 Ramez Elmasri and Shamkant Navathe1 Introduction to Transaction Processing (1)Single-User System:At most one user at a time can use the system. Multiuser System:Many users can access the system concurrently.Copyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Transaction Processing (2)A Transaction:Logical unit of database processing that includes one or more access operations (read -retrieval, write - insert or update, delete).A transaction (set of operations) may be stand-alone specified in a high level language like SQL submitted interactively, or may be embedded within a program.Transaction boundaries:Begin and End transaction.An application program may contain several transactions separated by the Begin and End transaction boundaries.Copyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Transaction Processing (3)SIMPLE MODEL OF A DATABASE (for purposes of discussing transactions):A database is a collection of named data itemsGranularity: size of the data item (a field, a record , or a whole disk block)Basic operations that a transaction can include are read and writeread_item(X): Reads a database item named X into a program variable. To simplify our notation, we assume that the program variable is also named X.write_item(X): Writes the value of program variable X into the database item named X.Copyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Transaction Processing (4)READ AND WRITE OPERATIONS:Basic unit of data transfer from the disk to the computer main memory is one block. In general, a data item (what is read or written) will be the field of some record in the database, although it may be a larger unit such as a record or even a whole block.read_item(X) command includes the following steps:Find the address of the disk block that contains item X.Copy that disk block into a buffer in main memory (if that disk block is not already in some main memory buffer).Copy item X from the buffer to the program variable named X.Copyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Transaction Processing (5)READ AND WRITE OPERATIONS (cont.):write_item(X) command includes the following steps:Find the address of the disk block that contains item X.Copy that disk block into a buffer in main memory (if that disk block is not already in some main memory buffer).Copy item X from the program variable named X into its correct location in the buffer.Store the updated block from the buffer back to disk (either immediately or at some later point in time).Copyright © 2011 Ramez Elmasri and Shamkant NavatheTwo Sample TransactionsCopyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Transaction Processing (6)Why Concurrency Control is needed:The Lost Update ProblemThis occurs when two transactions that access the same database items have their operations interleaved in a way that makes the value of some database item incorrect. The Temporary Update (or Dirty Read) Problem This occurs when one transaction updates a database item and then the transaction fails for some reason (see Section 21.1.4).The updated item is accessed by another transaction before it is changed back to its original value. The Incorrect Summary ProblemIf one transaction is calculating an aggregate summary function on a number of records while other transactions are updating some of these records, the aggregate function may calculate some values before they are updated and others after they are updated.Copyright © 2011 Ramez Elmasri and Shamkant NavatheConcurrent execution is uncontrolled: (a) The lost update problem.Copyright © 2011 Ramez Elmasri and Shamkant NavatheConcurrent execution is uncontrolled: (b) The temporary update problem.Copyright © 2011 Ramez Elmasri and Shamkant NavatheConcurrent execution is uncontrolled: (c) The incorrect summary problem.Copyright © 2011 Ramez Elmasri and Shamkant NavatheIntroduction to Transaction Processing (12)Why recovery is needed: (What causes a Transaction to
View Full Document