24-tx - Announcements(Tue Dec 6 Transaction Processing CPS...

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

View Full Document Right Arrow Icon
1 Transaction Processing CPS 116 Introduction to Database Systems 2 Announcements (Tue. Dec. 6) ± Extra credit (20 points) due today midnight ± Homework #4 due Thursday ² Sample solution available by email this weekend ± Project demo next Monday-Wednesday ² Submit your project report & code by demo time; see project description on course website for details ± Final exam in 2 weeks ² Open book, open notes; focus on the second half ² ² Review on Thursday 3 Review ± ACID ² Atomicity: TX’s are either completely done or not done at all ² Consistency: TX’s should leave the database in a consistent state ² Isolation: TX’s must behave as if they are executed in isolation ² Durability: Effects of committed TX’s are resilient against failures ± SQL transactions -- Begins implicitly SELECT …; UPDATE …; ROLLBACK | COMMIT; 4 Concurrency control ± Goal: ensure the “I” (isolation) in ACID A B C T 1 : read( A ); write( A ); read( B ); write( B ); commit; T 2 : read( A ); write( A ); read( C ); write( C ); commit; 5 Good versus bad schedules T 1 T 2 r( A ) w( A ) r( B ) w( B ) r( A ) w( A ) r( C ) w( C ) T 1 T 2 r( A ) w( A ) r( A ) w( A ) r( B ) r( C ) w( B ) w( C ) T 1 T 2 r( A ) r( A ) w( A ) w( A ) r( B ) r( C ) w( B ) w( C ) Good! Good! (But why?) Bad! Read 400 Read 400 Write 400 – 100 Write 400 – 50 6 Serial schedule ± Execute transactions in order, with no interleaving of operations ² T 1 .r( A ), T 1 .w( A ), T 1 .r( B ), T 1 .w( B ), T 2 .r( A ), T 2 .w( A ), T 2 .r( C ), T 2 .w( C ) ² T 2 .r( A ), T 2 .w( A ), T 2 .r( C ), T 2 .w( C ), T 1 .r( A ), T 1 .w( A ), T 1 .r( B ), T 1 .w( B ) ) Isolation achieved by definition! ± Problem: no concurrency at all ± Question: how to reorder operations to allow more concurrency
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 7 Conflicting operations ± Two operations on the same data item conflict if at least one of the operations is a write ² r( X ) and w( X ) conflict ² w( X ) and r( X ) conflict ² w( X ) and w( X ) conflict ² r( X ) and r( X ) do not ² r/w( X ) and r/w( Y ) do not ± Order of conflicting operations matters ² E.g., if T 1 .r( A ) precedes T 2 .w( A ), then conceptually, T 1 should precede T 2 8 Precedence graph ± A node for each transaction
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 01/17/2012.

Page1 / 4

24-tx - Announcements(Tue Dec 6 Transaction Processing CPS...

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

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