ACID properties, schedules, conflict and view serializability, recoverable, cascadeless and strict schedules, two-phase locking, deadlock handling and timestamp ordering, with the schedule tests GATE asks.
Lost updates and dirty reads are race conditions on shared data items.
Concept notes
1. Transactions and ACID
A transaction is a unit of work that reads and writes data items, ending in commit or abort. Its states are active → partially committed → committed, or active → failed → aborted.
Property
Meaning
Ensured by
Atomicity
All of the transaction happens or none of it
Recovery manager (undo using the log)
Consistency
A correct transaction takes the database from one consistent state to another
Programmer, plus integrity constraints
Isolation
Concurrent execution has the effect of some serial execution
Concurrency control manager
Durability
Committed changes survive crashes
Recovery manager (redo using the log)
Running transactions concurrently improves throughput and response time, but uncontrolled interleaving causes anomalies:
Lost update: two transactions read , both write it; one write is overwritten.
Dirty read (write–read conflict): reading a value written by a transaction that later aborts.
Unrepeatable read (read–write conflict): a transaction reads twice and sees different values because another transaction wrote in between.
Notation: and are a read and a write of by ; and are its commit and abort.
2. Conflict serializability
A schedule interleaves the operations of several transactions, keeping each transaction's own order. It is serial if transactions run one after another.
Two operations conflict if they belong to different transactions, touch the same item, and at least one is a write: –, – or –. Swapping adjacent non-conflicting operations does not change the result.
A schedule is conflict serializable (CS) if it can be turned into a serial schedule by such swaps.
Precedence graph test:
One node per transaction.
Edge if an operation of conflicts with a later operation of .
The schedule is CS if and only if the graph has no cycle.
Every topological order of an acyclic precedence graph is a conflict-equivalent serial schedule, so "how many serial schedules is conflict equivalent to?" means "count the topological sorts".
Scan each data item separately and list its operations in order; that makes the edges hard to miss.
Precedence graph of r2(X) r1(X) w2(Y) w1(X) r3(Y) w3(X). Each edge is labelled with one conflict that creates it.
3. View serializability
Two schedules and on the same transactions are view equivalent if:
Initial reads: if reads the initial value of in , it does so in .
Reads-from: if reads the value of written by in , it does so in .
Final writes: the transaction that writes last in also writes it last in .
is view serializable (VS) if it is view equivalent to some serial schedule.
Every CS schedule is VS, but not conversely.
A VS schedule that is not CS always contains a blind write (a write of without a preceding read of in that transaction).
Testing VS is NP-complete in general, so it is not used to control execution; for GATE, check the three conditions against each candidate serial order.
Quick route for a question: run the precedence graph test first. If acyclic, the schedule is CS and hence VS. If cyclic and there is no blind write, it is not VS either. Only a cyclic schedule with blind writes needs the full view check.
4. Recoverable, cascadeless and strict schedules
Serializability is about correctness without failures; recoverability is about aborts.
Class
Condition
Prevents
Recoverable
If reads a value written by , then commits before commits
A committed transaction that has read data from an aborted one
Cascadeless (ACA)
Transactions read only values written by committed transactions
Cascading rollback
Strict
No transaction reads or writes until the last writer of has committed or aborted
Undo becomes simply restoring the before-image
Containment: strict ⊂ cascadeless ⊂ recoverable ⊂ all schedules. These classes cut across serializability: a schedule can be serializable but not recoverable, or strict but not serializable.
How to classify: find every reads-from pair ( followed later by with no write in between).
If comes before (or commits and aborts), it is not recoverable.
If the read happens before , it is not cascadeless.
If some happens after an uncommitted , it is not strict.
5. Lock-based protocols and deadlock handling
Locks: a shared (S) lock allows reading; an exclusive (X) lock allows reading and writing. S is compatible only with S; X is compatible with nothing.
Two-phase locking (2PL): each transaction has a growing phase (acquires locks, releases none) and then a shrinking phase (releases locks, acquires none). The point of the last lock acquired is the lock point; ordering transactions by lock point gives an equivalent serial order.
Variant
Extra rule
Guarantees
Basic 2PL
None
Conflict serializable; not deadlock-free; cascading rollback possible
Strict 2PL
Hold X locks until commit/abort
CS and strict (so cascadeless)
Rigorous 2PL
Hold all locks until commit/abort
CS, strict; serial order = commit order
Conservative 2PL
Lock everything needed before starting
Deadlock-free
Deadlock prevention with timestamps (older = smaller timestamp). When requests a lock held by :
Wait-die (non-preemptive): if is older it waits; otherwise dies (rolls back).
Wound-wait (preemptive): if is older it wounds (aborts) ; otherwise waits.
In both, a restarted transaction keeps its original timestamp, so it eventually becomes the oldest and cannot starve. Deadlocks can also be detected with a wait-for graph (a cycle means deadlock) and broken by aborting a victim.
6. Timestamp ordering
Each transaction gets a unique timestamp when it starts; the protocol forces the serial order to be timestamp order. Each item keeps and , the largest timestamps that read and wrote it.
Basic timestamp ordering:
issues : if , abort (it would read a value from its future). Else read and set .
issues : if or , abort . Else write and set .
An aborted transaction restarts with a new timestamp.
Thomas write rule: in the write case, if but , the write is obsolete: ignore it instead of aborting. This admits some view-serializable schedules that are not conflict serializable.
Properties: timestamp ordering is conflict serializable (basic) and deadlock-free, because no transaction ever waits. It can starve a long transaction that keeps restarting, and without extra rules its schedules need not be recoverable.
Formulas to remember
Conflict condition
Conflict serializability test
Schedule class containmentSeparately: strict ⊂ cascadeless ⊂ recoverable
Interleavings of two transactions and operations; each keeps its own order
Basic TO write rule
Common mistakes
Adding an edge for two reads of the same item: read–read is never a conflict.
Drawing edges between operations of the same transaction.
Concluding a cyclic schedule is not view serializable without checking for blind writes.
Mixing up wait-die (older waits) and wound-wait (older wounds younger).
Assuming 2PL avoids deadlock or cascading rollback; only conservative 2PL avoids deadlock and only strict or rigorous 2PL avoids cascades.
Calling a schedule recoverable just because it is serializable; recoverability depends on commit order.
Worked examples
Try each step yourself, then reveal the working.
Example 1: Precedence graph and equivalent serial order
numerical
Is : conflict serializable? If so, give the equivalent serial order.
Step 1: List the operations on X in order.
Try it on paper first.
Example 2: Counting conflict-serializable interleavings
numerical
: and : . How many interleavings are there, and how many are conflict serializable?
Step 1: Count all interleavings.
Try it on paper first.
Example 3: Classifying a schedule for recoverability
conceptual
Classify : and : as non-recoverable, recoverable, cascadeless or strict.
Step 1: Find the reads-from pairs.
Try it on paper first.
Example 4: View serializable but not conflict serializable
conceptual
Show that : is view serializable but not conflict serializable.
Step 1: Draw the precedence graph.
Try it on paper first.
Previous year questions
15 official GATE CSE questions on this topic, newest first.
10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.
Mark as mastered
Loading your progress…
My revision notes
Notes written by the GATEiit team against the official GATE CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.