Propagation in depth
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
use propagation settings and know their traps.
Planned topics
REQUIRED(default): join the current transaction or start one.REQUIRES_NEW: suspend the current transaction and start an independent one, with its own connection; it commits or fails on its own.NESTED: a savepoint inside the current transaction (needs JDBC savepoint support); rollback goes back to the savepoint only.- Traps: self-invocation bypasses the proxy so annotations are ignored;
REQUIRES_NEWneeds a second connection, which can exhaust the pool; a caught runtime exception may still mark the shared transaction rollback-only.
Draft outline details
Demonstration
a table of the three propagations and a code sketch of a service calling another bean's @Transactional(propagation = REQUIRES_NEW) method.
Check your understanding
Why can REQUIRES_NEW exhaust the pool?
Show answer
Each nested call holds a second connection while the outer one is still held.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.