Presentation is loading. Please wait.

Presentation is loading. Please wait.

Session - 13 CONCURRENCY CONTROL CONCURRENCY TECHNIQUE Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Similar presentations


Presentation on theme: "Session - 13 CONCURRENCY CONTROL CONCURRENCY TECHNIQUE Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:"— Presentation transcript:

1 Session - 13 CONCURRENCY CONTROL CONCURRENCY TECHNIQUE Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

2 OBJECTIVES Concurrency control techniques, which are Locking method, timestamp method and optimistic methods Both locking and timestamping are essentially conservative approach Optimistic method based on the premise that conflict is rare and allow transaction to proceed unsynchronized and only check for conflicts at the end when a transaction commits.

3 Taxonomy of Concurrency Control Mechanism Concurrency Control Pessimistic Optimistic LockingTimestamp Ordering HybridLockingTimestamp Ordering Centralized Distributed Primary Copy Basic Multi Ver. Conservative

4 LOCKING METHODS Locking method are the most widely used approach to handling concurrent control in DBMS A transaction must claim a read (shared) or write (exclusive) lock on a data item prior to the execution of the corresponding read or write operation. Read operation  it is permissible for more than one transaction to hold read lock simultaneously Write Operation  it is transaction exclusive access As long as transaction hold write lock, no other transaction can read or update

5 LOCKING METHODS Cont’d The most common locking protocol known as two-phase locking (2PL). The 2PL operate in two distinct phase : Growing phase during which the transaction acquires Locks and A Shrinking phase during which it release those lock

6 LOCKING METHODS Cont’d The rules for transaction which obey 2PL are: Transaction are well-performed, must acquire a lock on data object before operating on it and release lock when the transaction is finished Compatibility rules for locking are observed, thus no conflicting locks are held. Once the transaction has released lock, no new locks are acquired All write locks are released together when transaction is commit

7 DEADLOCK T1T2 xj xi Simple Deadlock T1 is waiting for a lock on data item Xi which is currently held by transaction T2, while T2 is waiting for a lock on data item Xj which is currently held by transaction T1 G = T1  T2  T1

8 Distributed DeadLock Site A T1(A) T2(A) Site B T1(B) T2(B) Xi Xj


Download ppt "Session - 13 CONCURRENCY CONTROL CONCURRENCY TECHNIQUE Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:"

Similar presentations


Ads by Google