ch15 - Chapter15:Transactions DatabaseSystemConcepts,5thEd.

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.<number> Database System Concepts - 5 th  Edition, Sep 12, 2006. 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.<number> Database System Concepts - 5 th  Edition, Sep 12, 2006. Transaction Concept Transaction Concept transaction   is a  unit  of program execution that accesses and   possibly updates various data items. E.g. 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) 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.<number> Database System Concepts - 5 th  Edition, Sep 12, 2006. 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, money will be “lost”  leading to an inconsistent database state Failure could be due to software or hardware the system should ensure that updates of a partially executed transaction  are not reflected in the database Durability requirement  — once the user has been notified that the transaction  has completed (i.e., the transfer of the $50 has taken place), the updates to the  database by the transaction must persist even if there are software or hardware  failures.
Background image of page 4
©Silberschatz, Korth and Sudarshan 15.<number> Database System Concepts - 5 th  Edition, Sep 12, 2006. Example of Fund Transfer (Cont.) Example of Fund Transfer (Cont.) 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) Consistency requirement  in above example:  the sum of A and B is unchanged by the execution of the transaction In general, consistency requirements include  Explicitly specified integrity constraints such as primary keys and foreign  keys Implicit integrity constraints e.g. sum of balances of all accounts, minus sum of loan amounts  must equal value of cash-in-hand A transaction must see a consistent database.
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 04/28/2010 for the course CSE cse123 taught by Professor Benny during the Spring '10 term at LSU Eunice.

Page1 / 46

ch15 - Chapter15:Transactions DatabaseSystemConcepts,5thEd.

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