NIMCET, GATE, CUET & CBSE test series are live — start practicing free
syllabuzAI

Transactions and Concurrency Control in DBMS | GATE CSE

Chapter overview of transactions for GATE CSE DBMS: ACID, conflict and view serializability, recoverable and strict schedules, and 2PL and timestamp protocols.

5 min read

AS

Aman Singh

Updated 26 November 2026

On this page

Quick answer: A transaction is a group of database operations that forms one logical unit of work. It must satisfy ACID: atomicity and durability (recovery manager), isolation (concurrency-control manager) and consistency (programmer or DBA). Interleaved execution is described by schedules. A schedule is serializable if it is equivalent to some serial schedule, which you test with conflict serializability (acyclic precedence graph) or the broader view serializability. Schedules are also classed by recoverability: recoverable, cascadeless and strict. Two-phase locking (2PL) and timestamp ordering are protocols that only allow safe schedules.

Transactions questions show up regularly in GATE: testing conflict and view serializability, classifying schedules by recoverability, and checking whether 2PL or timestamp ordering would allow a schedule. This chapter page maps the area and links to four detailed notes.

Chapter overview

TopicKey ideasDetailed notes
Transactions, ACID and recoveryRead/write operations, ACID, logs, undo, redo, checkpointsACID and log-based recovery
SerializabilitySerial vs concurrent schedules, conflict pairs, precedence graph, view serializabilityConflict and view serializability
RecoverabilityDirty read, cascading rollback, recoverable, cascadeless and strict schedulesRecoverable, cascadeless and strict schedules
Concurrency controlShared and exclusive locks, 2PL variants, timestamp ordering, Thomas write rule2PL and timestamp ordering

Why concurrency needs control

  • In a simple file system, a whole file is often locked as one resource, so only one user can change it at a time.
  • A DBMS can lock individual records, so many users can work at once.
  • More concurrency means better throughput and response time, but without control it can produce wrong results.

ACID at a glance

PropertyMeaningEnsured by
AtomicityAll operations happen, or none doRecovery manager (undo)
ConsistencyA correct transaction moves the database from one consistent state to anotherProgrammer / DBA (plus integrity constraints)
IsolationConcurrent execution gives the same result as some serial orderConcurrency-control manager
DurabilityCommitted changes survive failuresRecovery manager (redo, logs, backups, RAID)

Schedules in brief

  • Serial schedule: transactions run one after another. n transactions have n! serial schedules. Always consistent, but no concurrency.
  • Concurrent schedule: operations interleave. Two transactions with n and m operations have this many interleavings:

(n+m)!n! m!\frac{(n+m)!}{n!\,m!}

  • Conflicting pair: two operations on the same item, from different transactions, with at least one write (R-W, W-R or W-W).
  • Conflict serializable: the precedence graph is acyclic. Its topological orders are the equivalent serial orders.
  • View serializable: same initial reads, reads-from relationships and final writes as some serial schedule. Every conflict-serializable schedule is view serializable, and a view-serializable schedule that is not conflict serializable must contain blind writes.

Recoverability in brief

ClassRule
RecoverableIf Tj reads a value written by Ti, Tj commits only after Ti commits
CascadelessTransactions read only committed values (no dirty reads)
StrictNo transaction reads or writes an item last written by an uncommitted transaction

Strict ⊂ cascadeless ⊂ recoverable.

Concurrency control protocols in brief

ProtocolSerializabilityStrict schedulesDeadlock free
Basic 2PLConflictNoNo
Strict 2PLConflictYesNo
Rigorous 2PLConflictYesNo
Conservative 2PLConflictNot guaranteedYes
Basic timestamp orderingConflictNoYes
Thomas write ruleViewNoYes
Strict timestamp orderingConflictYesYes

Worked example

Question: S: R1(A), W2(A), W1(A), W3(A). Is S conflict serializable? Is it view serializable?

Step 1: R1(A) before W2(A) gives T1 → T2. W2(A) before W1(A) gives T2 → T1. The precedence graph has a cycle, so S is not conflict serializable.

Step 2: T1 reads the initial A, T3 makes the final write, and there are no other reads. The serial order T1, T2, T3 has the same initial read and final write, so S is view serializable.

Step 3: W2(A) and W3(A) are blind writes, which is why S can be view serializable without being conflict serializable.

Exam tips

  • Treat every schedule question as three separate checks: is it serializable, is it recoverable, and would the named protocol allow it?
  • For serializability, draw the precedence graph before anything else.
  • For recoverability, look only at reads and writes of items written by uncommitted transactions, then compare commit order.

Common mistakes

  • Treating operations on different items as conflicts. A conflict needs the same data item.
  • Assuming view serializable means conflict serializable. It's the other way round.
  • Assuming serializable means recoverable. The two properties are independent.
  • Thinking basic 2PL prevents cascading rollbacks. You need strict 2PL for that.

Practice questions

Q1. How many serial schedules exist for 4 transactions?

Answer: 4! = 24.

Q2. T1 has 3 operations and T2 has 2. How many concurrent schedules keep each transaction's own order?

Answer:

5!3! 2!=10\frac{5!}{3!\,2!} = 10

Q3. Which ACID property is mainly the programmer's responsibility?

Answer: Consistency.

FAQs

What is a transaction in DBMS?

It is a sequence of database operations treated as one logical unit of work. Either all of it takes effect or none of it does.

What is the difference between conflict and view serializability?

Conflict serializability means the schedule can be turned into a serial one by swapping adjacent non-conflicting operations. View serializability only needs the same initial reads, reads-from relationships and final writes, so it is the broader class.

Does two-phase locking prevent deadlock?

No. Basic, strict and rigorous 2PL can all deadlock. Only conservative 2PL avoids it, by taking every lock in advance.

What is a cascadeless schedule?

It is a schedule where every transaction reads only values written by committed transactions, so one abort never forces others to roll back.

How many interleavings do two transactions with n and m operations have?

They have (n+m)! / (n! × m!) interleavings that keep each transaction's own operation order.

Conclusion

Work through the detailed notes on ACID and recovery, serializability, recoverability and concurrency control protocols. For storage-level background, see File Organization and Indexing.

Concept Check

EASY

Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called

Suggested for you