1 / 17

Chapter 6. Concurrency control

Chapter 6. Concurrency control. Databases and Applications with Relaxed ACID Properties. •. Often Deadlock prevention is impossible:. Example: In e-commerce products may be put in the basket in any order. •. Pessimistic concurrency control:.

aimon
Download Presentation

Chapter 6. Concurrency control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 6. Concurrency control Databases and Applications with Relaxed ACID Properties •

  2. Often Deadlock prevention is impossible: Example:In e-commerce products may be put in the basket in any order. •

  3. Pessimistic concurrency control: • Locking is a pessimistic concurrency control, because access for a new transaction to data is blocked if there is a chance for conflict with old accesses. Therefore, there are no conflicts when a transaction is committed. (What is a conflict between transactions?) On the other hand, transactions may have waited for non existing conflicts or expierensed deadlock. •

  4. What is read-write conflicts? What is write-write conflicts?

  5. Optimistic concurrency control • Concurrency control is optimistic if access to committed data always is allowed. Therefore, there are no access to updated data before it is committed. • A transaction can only commit if it has no conflicts at the time of commit.(Backward validation). •

  6. The anomalies of SQL’s isolation levels

  7. Different lock durations: • Long duration locks = All locks are obtain before global commit and released after global commit • Short duration locks = All locks are obtained and released in local transactions executed both before and after global commit.Short duration locks does not lock data accross a dialog with the user or when there is a risk for deadlock.

  8. Long-lived transactions Long-lived transactions are transactions where only short duration locking are acceptable. • workflows are normally long-lived • in cooperative work there is a need for user notification which is a countermeasure to prevent anomalies. • applications such as cooperative CAD need user involvement in conflict resolution •

  9. Hotspots: A hotspot is a record normally updated by many concurrent transactions. In hotspots, pessimistic concurrency control is generally better than optimistic concurrency control (O’Neil, 1986). However, a hotspot is best managed by using short duration locking around the hotspot. Examples: • In e-commerce best-seller products may be hot spots • The generator of transaction sequense numbers.

  10. Methods to increase concurrency

  11. ERP system: Exercise What concurrency control method would you recommend in e-commerce systems?

  12. End of session Thank you !!!

  13. Evaluering af concurrency control metoderne: Design af DBMS/transaktioner så en rette information haves til rette tid til rette person/system på rette sted i rette kvalitet (consistency) til de mindste omkostninger.

  14. Short duration locking: Ved kort låsning låses der ikke på tværs af en brugerdialog/subtransaktioner samt ved risiko for deadlock og andre problemer, som gør låsetiden uforudsigelig. I denne situation må man bruge modforholdsregler mod de mulige anomalies samt kompensering på tværs af opdaterende subtransaktioner i stedet for roll back retablering. Eksempler: E-handel samt lagerstyring generelt.

More Related