csce824-lecture7(1)

csce824-lecture7(1) - Notes09:TransactionProcessing

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

View Full Document Right Arrow Icon
1 Notes 09: Transaction Processing Slides are modified from the CS  245 class slides of Hector Garcia- Molina
Background image of page 1

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

View Full DocumentRight Arrow Icon
Reading Chapter 10.1, 10.2 Chapter 11.1 – 11.3, 11.6 2
Background image of page 2
Transactions A sequence of operations on one or  more data items.   Fundamental assumption: a transaction  when run on a consistent state and  without interference with other  transactions will leave the database in a  consistent state. 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Termination of Transactions Commit: guarantee that all of the  changes of the transaction are  permanent Abort: guarantee that none of the  effects of the transaction are permanent Reason for abort: user, transaction, system  failure 4
Background image of page 4
5 Chapter 9 Concurrency Control    T1 T2 Tn DB (consistency constraints)
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Example: T1: Read(A) T2: Read(A)  A+100  A × 2 Write(A) Write(A) Read(B) Read(B)  B+100 B × 2 Write(B) Write(B) Constraint:  A=B
Background image of page 6
7 Schedule A T1 T2 Read(A); A   A+100 Write(A); Read(B); B    B+100; Write(B); Read(A);A    A × 2; Write(A);      Read(B);B    B × 2; Write(B); A B 25 25 125 125 250 250 250 250
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Schedule B T1 T2 Read(A);A    A × 2; Write(A); Read(B);B    B × 2; Write(B); Read(A); A   A+100 Write(A); Read(B); B    B+100; Write(B); A B 25 25 50 50 150 150 150 150
Background image of page 8
9 Schedule C T1 T2 Read(A); A   A+100 Write(A); Read(A);A    A × 2; Write(A); Read(B); B    B+100; Write(B);      Read(B);B    B × 2; Write(B); A B 25 25 125 250 125 250 250 250
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Schedule D T1 T2 Read(A); A   A+100 Write(A); Read(A);A    A × 2; Write(A);      Read(B);B    B × 2; Write(B); Read(B); B    B+100; Write(B); A B 25 25 125 250 50 150 250 150
Background image of page 10
11 Schedule E T1 T2’ Read(A); A   A+100 Write(A); Read(A);A    A × 1; Write(A);      Read(B);B    B × 1; Write(B); Read(B); B    B+100; Write(B); A B 25 25 125 125 25 125 125 125 Same as Schedule D but with new T2’
Background image of page 11

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

View Full DocumentRight Arrow Icon
12 Want schedules that are “good”, regardless of initial state and transaction semantics Only look at order of read and writes Example:  Sc=r 1 (A)w 1 (A)r 2 (A)w 2 (A)r 1 (B)w 1 (B)r 2 (B)w 2 (B)
Background image of page 12
13 Sc’=r 1 (A)w 1 (A) r 1 (B)w 1 (B)r 2 (A)w 2 (A)r 2 (B)w 2 (B)      T 1          T 2 Example:  Sc=r 1 (A)w 1 (A)r 2 (A)w 2 (A)r 1 (B)w 1 (B)r 2 (B)w 2 (B)
Background image of page 13

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

View Full DocumentRight Arrow Icon
14 However, for Sd: Sd=r 1 (A)w 1 (A)r 2 (A)w 2 (A) r 2 (B)w 2 (B)r 1 (B)w 1 (B) as a matter of fact,        T must precede T         in any equivalent schedule,         i.e.,  T 2    T 1
Background image of page 14
15 T 1     T 2 Sd cannot be rearranged into a serial schedule Sd is not “equivalent” to any serial schedule Sd is “bad”   T 2    T   Also, T 1    T 2
Background image of page 15

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

View Full DocumentRight Arrow Icon
16 Returning to Sc Sc=r 1 (A)w 1
Background image of page 16
Image of page 17
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/13/2011 for the course CSCE 824 taught by Professor Staff during the Fall '11 term at South Carolina.

Page1 / 85

csce824-lecture7(1) - Notes09:TransactionProcessing

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

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