Docsity

Concurrency Control - Data Base Management System - Lecture Slides, Slides of Database Management Systems (DBMS)

Partial preview of the text

Download Concurrency Control - Data Base Management System - Lecture Slides and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

Concurrency Control

Introduction

• Transactions are characterized by the ACID

properties:

– Atomicity: The effect of the transaction is all or

nothing.

– Isolation: The effect of concurrent transactions

should be equivalent to a serial execution of them.

– Durability: The effect of successful transactions is

not lost.

Concurrency Control Issues

>Mary updates data in her work area, so..

•<Tom updates database from his work area,

•Thus by Mary’s update of the data base, Tom’s update is lost.

Moreover, rather than a balance for Acme of $418, the database

will have an incorrect balance of $318.

•(Note that if Mary’s update had occurred prior to Tom’s, the

database would have contained $518 as Acme’s balance, which is

also incorrect.)

DEALING WITH SHARED

UPDATE

(a.k.a CONCURRENT UPDATE)

1. Avoidance Approach (Do not allow users to perform a shared update!)

Can maintain a separate file of updates which will be run periodically to update the actual database.{Big problem with this is maintaining the “currency” of the database.}

Note that shared viewing is not problem, it is shared updates.

  1. LOCKING

A record becomes LOCKED for a particular user if no other user may access it while it is locked..

Thus,if Tom’s access of Acme’s balance LOCKED that record, then Mary could not have done her update( and the resulting balance for Acme would have been correct.)

During a LOCK, any attempt by another user to access that record is rejected.Docsity.com