Demo: finding the self-invocation bug
On This Lesson 3 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
diagnose a transaction that never starts; prepares JNR-031-LAB1.
Draft outline details
Step by step
- Run the money-transfer exercise: a failure after debit leaves money missing.
- Check the code:
transfer()callsthis.debitAndCredit(), which has the annotation. - Prove it with the transaction log (
logging.level.org.springframework.transaction=TRACE): no transaction begins. - Planned mistake: mark the private method
@Transactionaland show it still does nothing. - Fix it by moving the method to another bean (or annotating the public entry point); re-run the failure test.
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.