Demo: entity states in the debugger
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
observe entity states and flush timing live; prepares JNR-028-LAB1.
Draft outline details
Step by step
- Put breakpoints in a transactional test around
new,persist, a setter, and the end of the method. - Inspect the entity: id
nullwhile transient; useentityManager.contains(p)to show managed. - Change a field and show that the SQL log stays silent until
flush()or commit. - Planned mistake: modify an entity after the transaction ended (detached); show nothing is saved, then fix with
mergeinside a transaction. - Call
removeand show theDELETEis sent at flush.
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.