Validation Based Protocol
By:-NIKHIL BHATIA
What it is ?
Execution of each transaction Ti has 3
phases:-
1. Read and Execution Phase: Transaction writes
to temporary local variable.
2. Validation Phase: Validation test is performed to
check for updation and serializability.
3. Write Phase: If validated, updates written back
to databases, else rolled back
Validation Based Protolcol (cont..)
Three Phases are necessary for each
transactions.
Phases can interleave one another of
different transactions.
Assumes validation will hold.
Validation Based Protolcol (cont..)
Has 3 timestamps:- Start (Ti), Validation (Ti)
and Finish (Ti).
Serializabilty order is determined at validation
time.
If probability of conflict is Low, gives high
degree of concurrency
Validation Test
If for all Ti with TS (Ti) < TS (Tj), on of the
following condition holds:
1. Finish (Ti) < Start (Tj), or
2. Start (Tj) < Finish (Ti) < Valitade (Tj) & set of data
items written by Ti are not read by Tj.
If validation successes, then updations are
committed else rolled back.
Multiple Granularity
(MGL)
BY:- NIKHIL BHATIA
Problems With Simple Locking
Hard to decide which granularity to lock (i.e
table or page or record)
Data containers are nested
Defination
Locks are set on objects that contain other objects.
MGL exploits the hierarchial nature of the contains
relationship.
For example, a database may have files, which
contain pages, which contain records. This can be
thought of as a tree of objects, where each node
contains its children.
A lock locks a node and its descendants.
Working Of MGL
In addition to shared (S) locks and exclusive (X)
locks from other locking schemes, MGL also uses
intention shared and intention exclusive locks
IS locks conflict with X locks, while IX locks conflict
with S and X locks.
To lock a node in S (or X), MGL has the transaction
locks all of its ancestors with IS (or IX)
so if a transaction locks a node in S (or X), no other
transaction can access its ancestors in X (or S and
X).
Type of Granularity
Fine Granularity:- High Locking overhead,
Lower in tree, High level of concurrency.
Coarse Granularity:- Low Locking overhead,
Higher in tree, Low level of concurrency.
Uses Of MGL
Multiple granularity locking is usually used
with Non-strict two-phase locking to
guarantee serializability.
MGL uses lock escalation to determine
granularity lock on a node and its ancestors.