💳 Section 11 · 22 questions
Transactions
22 interview questions and answers in the Transactions section.
Questions in this section
- Explain Each Letter of ACID
- What Transaction Isolation Levels Exist
- What is Read Uncommitted
- What is Read Committed
- What is Repeatable Read
- What is Serializable
- What is Dirty Read
- What is Non-Repeatable Read
- What is Phantom Read
- What is Lost Update
- What is the Default Isolation Level in PostgreSQL
- What is the Default Isolation Level in MySQL
- What is Transaction Propagation in Spring
- What Does Propagation NESTED Do
- What is the Difference Between REQUIRED and REQUIRES_NEW
- What is the Transactional Annotation
- At What Level Can Transactional Be Used
- What is Rollback in Transactions
- Which Exceptions Trigger Rollback by Default
- How to Configure Rollback for Checked Exceptions
- What is a ReadOnly Transaction
- 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)
- Understand the core ACID guarantees: Explain Each Letter of ACID.
- Learn the 4 standard SQL isolation levels: What Transaction Isolation Levels Exist.
- Understand the basic anomalies: What is Dirty Read and What is Non-Repeatable Read.
- Master Spring transaction basics: What is the Transactional Annotation and Which Exceptions Trigger Rollback by Default.
🟡 Middle Track (Isolation Mechanics & Propagation)
- 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.
- Prevent concurrency overwrites: What is Lost Update.
- Master Spring propagation rules: What is Transaction Propagation in Spring and What is the Difference Between REQUIRED and REQUIRES_NEW.
- Configure fine-grained rollbacks: How to Configure Rollback for Checked Exceptions and What Does Propagation NESTED Do.
🔴 Senior Track (Highload, AOP Proxies & Concurrency Pitfalls)
- Dive into Serializable Snapshot Isolation (SSI): What is Serializable.
- Optimize Hibernate/JPA read throughput: What is a ReadOnly Transaction.
- Diagnose and eliminate Spring AOP proxy self-invocation bugs: What Happens When Calling a Transactional Method from Another Method in the Same Class.
- Prevent connection pool exhaustion when nesting
REQUIRES_NEWtransactions.