Skip to main content

Interview Questions: Transactions, Data Access, Security, Testing and Scenarios

Learn Interview Questions: Transactions, Data Access, Security, Testing and Scenarios (Phase 20 · Spring Core Interview Questions (Interview), Spring Core) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Scenario-style answers • "Payment succeeded but the order was rolled back" → payment call inside the DB transaction: use outbox/saga, idempotency keys and compensation; do external calls after commit. • "Audit row must persist even when the main operation fails" → REQUIRES_NEW in a separate bean. • "Slow startup" → measure with startup endpoint, narrow scanning, lazy init, AOT/CDS. • "Intermittent LazyInitializationException" → access lazy data inside the transaction or use projections; avoid open-session-in-view.

More lessons in Phase 20 · Spring Core Interview Questions (Interview)