Validation based protocol

14,054 views 11 slides Nov 11, 2016
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

This protocol is used in the concurrency control techniques in DBMS. This ppt will help you to know about the validation based protocol in DBMS.


Slide Content

Validation Based Protocol ANKUR SRIVASTAVA DEPT OF CSE JETGI, BBK 1

Definition: - In optimistic concurrency control techniques, also known as  validation  or certification techniques, no checking is done while the transaction is executing.  Also based on Timestamp Protocol. It has three phases: Read Phase:-   During this phase, the system executes transaction T i.  . It reads the values of the various data items and stores them in variable local to T i . It performs all the write operations on temporary local variables without update of the actual database. 2

Validation Phase:-  Transaction T i  performs a validation test to determine whether it can copy to database the temporary local variables that hold the result of write operations without causing a violation of serializability . Write Phase:-   If Transaction T i  succeeds in validation, then the system applies the actual updates to the database, otherwise the system rolls back T i . 3

To perform the validation test, we need to know when the various phases of transaction T i took place. We shall therefore associate three different timestamps with transaction T i . 1.        Start (T i ) : the time when T i , started its execution. 2.        Validation (T i ):  the time when T i  finished its read phase and started its validation phase. 3.        Finish (T i) : the time when T i  finished its write phase. 4

The Validation Test for T j    requires that, for all transaction T i   with TS(T i   ) < TS( T j    ) one of the following condition must hold:-  Finish (T i)  < Start ( T j ): Since T i   completes its execution before T j    started, the serializability order is indeed maintained.   Start( T j   )<Finish(T i   ) <validation( T j    ): The validation phase of T j   should occur after T i finishes . 5

Multiple Granularity Multiple granularity  locking (MGL) is a locking method used in database management systems (DBMS) and relational databases. In MGL, locks are set on objects that contain other objects. ... For example, a database may have files, which contain pages, which further contain records. 6

Allow data items to be of various sizes and define a hierarchy of data granularities, where the small granularities are nested within larger ones Can be represented graphically as a tree (but don't confuse with tree-locking protocol) When a transaction locks a node in the tree explicitly , it implicitly locks all the node's descendents in the same mode. 7

Granularity of locking (level in tree where locking is done): fine granularity (lower in tree): high concurrency, high locking overhead coarse granularity (higher in tree): low locking overhead, low concurrency 8

Example of Granularity Hierarchy 9

The highest level in the above example hierarchy is the entire database. The levels below are of type area , file and record in that order. Intention Lock Modes:-In addition to S and X lock modes, there are three additional lock modes with multiple granularity: intention-shared (IS): indicates explicit locking at a lower level of the tree but only with shared locks. intention - exclusive (IX): indicates explicit locking at a lower level with exclusive or shared locks shared and intention - exclusive (SIX): the subtree rooted by that node is locked explicitly in shared mode and explicit locking is being done at a lower level with exclusive-mode locks. intention locks allow a higher level node to be locked in S or X mode without having to check all descendent nodes. 10

THANKS 11
Tags