Level 1 · Apprentice0 XP
Rollback rules, propagation and read-only, and the mistakes that silently disable them.
Step 1 / 5
ProblemA transfer withdraws from one account, then fails while depositing to the other. The withdrawal was committed. The method had @Transactional, and it did nothing.
← → step
Before this: The N+1 query problem
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write a transfer service and three tests: the deposit throws a RuntimeException and both accounts are unchanged; the same with the exception caught inside the method, showing the withdrawal is kept; and an audit entry written with REQUIRES_NEW that survives the rollback.