ch15 - Chapter 15: Transactions Database System Concepts,...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Database System Concepts, 5th Ed . ©Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-use Chapter 15: Transactions Chapter 15: Transactions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
©Silberschatz, Korth and Sudarshan 15.2 Database System Concepts - 5 th Edition, Sep 10, 2005. Chapter 15: Transactions Chapter 15: Transactions Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing for Serializability.
Background image of page 2
©Silberschatz, Korth and Sudarshan 15.3 Database System Concepts - 5 th Edition, Sep 10, 2005. Transaction Concept Transaction Concept A transaction is a unit of program execution that accesses and possibly updates various data items. A transaction must see a consistent database. During transaction execution the database may be temporarily inconsistent. When the transaction completes successfully (is committed), the database must be consistent. After a transaction commits, the changes it has made to the database persist, even if there are system failures. Multiple transactions can execute in parallel. Two main issues to deal with: Failures of various kinds, such as hardware failures and system crashes Concurrent execution of multiple transactions
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
©Silberschatz, Korth and Sudarshan 15.4 Database System Concepts - 5 th Edition, Sep 10, 2005. ACID Properties ACID Properties Atomicity . Either all operations of the transaction are properly reflected in the database or none are. Consistency . Execution of a transaction in isolation preserves the consistency of the database. Isolation . Although multiple transactions may execute concurrently, each transaction must be unaware of other concurrently executing transactions. Intermediate transaction results must be hidden from other concurrently executed transactions. That is, for every pair of transactions T i and T j , it appears to T i that either T j , finished execution before T i started, or T j started execution after T i finished. Durability . After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures. A transaction is a unit of program execution that accesses and possibly updates various data items.To preserve the integrity of data the database system must ensure:
Background image of page 4
©Silberschatz, Korth and Sudarshan 15.5 Database System Concepts - 5 th Edition, Sep 10, 2005. Example of Fund Transfer Example of Fund Transfer Transaction to transfer $50 from account A to account B: 1. read ( A ) 2. A := A – 50 3. write ( A ) 4. read ( B ) 5. B := B + 50 6. write ( B) Atomicity requirement — if the transaction fails after step 3 and before step 6, the system should ensure that its updates are not reflected in the database, else an inconsistency will result.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/22/2011 for the course CS 1112 taught by Professor Dr.d during the Fall '11 term at McMaster University.

Page1 / 47

ch15 - Chapter 15: Transactions Database System Concepts,...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online