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

Info icon This 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 Sample final & solution available 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
Image of page 1

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

View Full Document Right 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 A directed edge from T i to T j if an operation of T i precedes and conflicts with an operation of T j in the schedule 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 )
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern