Explain transaction propagation in Spring Boot
Reported in Improbable European engineering loops. Framework internals question common in backend interviews.
Interview scenario
Context for Improbable candidates:
What do REQUIRED, REQUIRES_NEW, and MANDATORY mean in Spring transactions?
Model answer
Try answering aloud first
Cover trade-offs, structure, and a concrete example before revealing the baseline response.
How to frame this at Improbable: Connect your answer to measurable impact, clarity of thought, and trade-offs the team cares about. Below is a strong baseline response you can adapt with your own project examples.
REQUIRED joins an existing transaction if present, otherwise creates a new one; it is default and suits most service methods. REQUIRES_NEW always starts an independent transaction, suspending the outer one.
MANDATORY requires an existing transaction and throws if none exists, useful for enforcing transactional call contracts. Mention proxy-based behavior: annotations on internal self-calls may not trigger transaction interception.
In interviews, connect propagation choice to business needs such as audit logs that should commit even when main workflow fails.
Discussion
Comments (0)
Share how this question came up in your loop, or add tips for others preparing.
Log in to comment on this question.