💳 Section 11 · 22 questions

Transactions

22 interview questions and answers in the Transactions section.

Questions in this section

  1. Explain Each Letter of ACID
  2. What Transaction Isolation Levels Exist
  3. What is Read Uncommitted
  4. What is Read Committed
  5. What is Repeatable Read
  6. What is Serializable
  7. What is Dirty Read
  8. What is Non-Repeatable Read
  9. What is Phantom Read
  10. What is Lost Update
  11. What is the Default Isolation Level in PostgreSQL
  12. What is the Default Isolation Level in MySQL
  13. What is Transaction Propagation in Spring
  14. What Does Propagation NESTED Do
  15. What is the Difference Between REQUIRED and REQUIRES_NEW
  16. What is the Transactional Annotation
  17. At What Level Can Transactional Be Used
  18. What is Rollback in Transactions
  19. Which Exceptions Trigger Rollback by Default
  20. How to Configure Rollback for Checked Exceptions
  21. What is a ReadOnly Transaction
  22. What Happens When Calling a Transactional Method from Another Method in the Same Class

Study navigator

A comprehensive, production-grade guide to Database Transactions, ACID Properties, SQL Isolation Levels, Database Concurrency Anomalies, and Spring Framework Transaction Management (@Transactional).


📋 All Questions in This Section

# Question Title Focus Area Difficulty
01 Explain Each Letter of ACID Database Fundamentals & Guarantees 🟢 Junior
02 What Transaction Isolation Levels Exist ANSI SQL Isolation Hierarchy 🟢 Junior
03 What is Read Uncommitted Lowest Isolation & Dirty Reads 🟢 Junior
04 What is Read Committed Statement-Level MVCC Snapshots 🟢 Junior
05 What is Repeatable Read Transaction-Level MVCC & Locking 🟡 Middle
06 What is Serializable Strict Serializability & SSI 🔴 Senior
07 What is Dirty Read Reading Uncommitted In-Flight Data 🟢 Junior
08 What is Non-Repeatable Read Modifying Committed Data Between Reads 🟢 Junior
09 What is Phantom Read Range Insertions & Gap Locks 🟡 Middle
10 What is Lost Update Concurrent Overwrites & Optimistic Locking 🟡 Middle
11 What is the Default Isolation Level in PostgreSQL PostgreSQL MVCC & Read Committed 🟡 Middle
12 What is the Default Isolation Level in MySQL MySQL InnoDB Next-Key Locks 🟡 Middle
13 What is Transaction Propagation in Spring Spring Transaction Demarcation 🟡 Middle
14 What Does Propagation NESTED Do JDBC Savepoints & Partial Rollback 🟡 Middle
15 What is the Difference Between REQUIRED and REQUIRES_NEW Transaction Boundaries & Deadlocks 🟡 Middle
16 What is the Transactional Annotation Spring AOP & PlatformTransactionManager 🟢 Junior
17 At What Level Can Transactional Be Used Class vs Method Scoping & Inheritance 🟢 Junior
18 What is Rollback in Transactions Aborting & Undoing Uncommitted State 🟢 Junior
19 Which Exceptions Trigger Rollback by Default RuntimeException vs Checked Exception 🟢 Junior
20 How to Configure Rollback for Checked Exceptions rollbackFor & noRollbackFor 🟡 Middle
21 What is a ReadOnly Transaction FlushMode.MANUAL & DB Optimizations 🟡 Middle
22 What Happens When Calling a Transactional Method from Another Method in the Same Class Self-Invocation & Spring Proxy Bypass 🔴 Senior

🗺️ Topic Dependency & Conceptual Map

                           ┌──────────────────────────────────────────────┐
                           │      DATABASE TRANSACTION FOUNDATIONS        │
                           │   • 01. ACID Principles & Invariants         │
                           │   • 02. ANSI SQL Isolation Level Hierarchy   │
                           └──────────────────────┬───────────────────────┘
                                                  │
                ┌─────────────────────────────────┼─────────────────────────────────┐
                ▼                                 ▼                                 ▼
    ┌───────────────────────┐         ┌───────────────────────┐         ┌───────────────────────┐
    │  ISOLATION LEVELS     │         │ CONCURRENCY ANOMALIES │         │ DATABASE ENGINES      │
    │  • 03. Read Uncomm.   │         │ • 07. Dirty Read      │         │ • 11. PostgreSQL MVCC │
    │  • 04. Read Committed │         │ • 08. Non-Repeatable  │         │ • 12. MySQL Next-Key  │
    │  • 05. Repeatable Read│         │ • 09. Phantom Read    │         └───────────┬───────────┘
    │  • 06. Serializable   │         │ • 10. Lost Update     │                     │
    └───────────┬───────────┘         └───────────┬───────────┘                     │
                │                                 │                                 │
                └─────────────────────────────────┼─────────────────────────────────┘
                                                  ▼
                           ┌──────────────────────────────────────────────┐
                           │       SPRING TRANSACTION MANAGEMENT          │
                           │   • 16. @Transactional Annotation & AOP      │
                           │   • 17. Class vs Method Level Scoping        │
                           │   • 13. Propagation Behaviors Overview       │
                           │   • 14. NESTED & JDBC Savepoints             │
                           │   • 15. REQUIRED vs REQUIRES_NEW             │
                           └──────────────────────┬───────────────────────┘
                                                  │
                ┌─────────────────────────────────┼─────────────────────────────────┐
                ▼                                 ▼                                 ▼
    ┌───────────────────────┐         ┌───────────────────────┐         ┌───────────────────────┐
    │ ROLLBACK MECHANICS    │         │ PERFORMANCE & READS   │         │ ADVANCED AOP PROXY    │
    │ • 18. Rollback Basics │         │ • 21. readOnly = true │         │ • 22. Self-Invocation │
    │ • 19. Default Rules   │         │   (FlushMode.MANUAL)  │         │   Bypass & Solutions  │
    │ • 20. rollbackFor     │         └───────────────────────┘         └───────────────────────┘
    └───────────────────────┘

🎯 Structured Learning Tracks

🟢 Junior Track (Core Transaction Concepts)

  1. Understand the core ACID guarantees: Explain Each Letter of ACID.
  2. Learn the 4 standard SQL isolation levels: What Transaction Isolation Levels Exist.
  3. Understand the basic anomalies: What is Dirty Read and What is Non-Repeatable Read.
  4. Master Spring transaction basics: What is the Transactional Annotation and Which Exceptions Trigger Rollback by Default.

🟡 Middle Track (Isolation Mechanics & Propagation)

  1. Contrast MVCC in PostgreSQL vs Next-Key Locking in MySQL: What is the Default Isolation Level in PostgreSQL vs What is the Default Isolation Level in MySQL.
  2. Prevent concurrency overwrites: What is Lost Update.
  3. Master Spring propagation rules: What is Transaction Propagation in Spring and What is the Difference Between REQUIRED and REQUIRES_NEW.
  4. Configure fine-grained rollbacks: How to Configure Rollback for Checked Exceptions and What Does Propagation NESTED Do.

🔴 Senior Track (Highload, AOP Proxies & Concurrency Pitfalls)

  1. Dive into Serializable Snapshot Isolation (SSI): What is Serializable.
  2. Optimize Hibernate/JPA read throughput: What is a ReadOnly Transaction.
  3. Diagnose and eliminate Spring AOP proxy self-invocation bugs: What Happens When Calling a Transactional Method from Another Method in the Same Class.
  4. Prevent connection pool exhaustion when nesting REQUIRES_NEW transactions.