{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

chapter12 - Chapter 12 Transactions and Concurrency Control...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction Transactions Nested transactions Locks Optimistic concurrency control Timestamp ordering Comparison of methods for concurrency control Summary Chapter 12: Transactions and Concurrency Control
Image of page 1

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

View Full Document Right Arrow Icon
The goal of transactions All objects remain in a consistent state when they are accessed by multiple transactions and in the presence of server crashes Concurrency control Enhance reliability Recovery from failures Record in permanent storage The banking example Introduction
Image of page 2
Multi-threaded banking server Atomic operations Operations that are free from interference from concurrent operations being performed in other threads Only one thread can access an account at a time Public synchronized void deposit(int amount) {…} Synchronization of server operations Mutual exclusion Synchronized … Producer/Consumer E.g., wait and notify in Java Simple synchronization (without transaction)
Image of page 3

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

View Full Document Right Arrow Icon
Writes to permanent storage may fail Write nothing or wrong value file storage may decay reading bad data can be detect (by checksum) Servers may crash occasionally Memory recover to the last updated state continue recovery using information in permanent storage no arbitrary failure An arbitrary delay of a message A message may be lost, duplicated or corrupted The recipient can detect corrupted messages Failure model for transactions [lamport1981]
Image of page 4
Introduction Transactions Nested transactions Locks Optimistic concurrency control Timestamp ordering Comparison of methods for concurrency control Summary Chapter 12: Transactions and Concurrency Control
Image of page 5

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

View Full Document Right Arrow Icon
What is a transaction? A sequence of separate operations that execute in a atomic manner Free from interference by operations that belong to different transaction Nothing-or-all semantics of the transaction An example All or nothing Failure atomicity durability Isolation Transactions
Image of page 6
Atomicity A transaction must be all or nothing Consistency A transaction takes the system from one consistent state to another consistent state The state during a transaction is invisible to another Isolation Serially equivalent or serializable Durability ACID properties
Image of page 7

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

View Full Document Right Arrow Icon
Transaction coordinator Each transaction is created and managed by a coordinator Result of a transaction Success Aborted Initiated by client Initiated by server Example Use a transaction
Image of page 8
The lost update problem The final balance of b should be $242 rather than $220 Inconsistent retrievals The total should be $400 rather than $300 Concurrency control
Image of page 9

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

View Full Document Right Arrow Icon
What is serial equivalence?
Image of page 10
Image of page 11
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