Skip to content
Ameen Abozaid
Planned lessonJNR-028-L08

Demo: entity states in the debugger

  • Lesson 8 of 8
  • Junior
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

  1. Put breakpoints in a transactional test around new, persist, a setter, and the end of the method.
  2. Inspect the entity: id null while transient; use entityManager.contains(p) to show managed.
  3. Change a field and show that the SQL log stays silent until flush() or commit.
  4. Planned mistake: modify an entity after the transaction ended (detached); show nothing is saved, then fix with merge inside a transaction.
  5. Call remove and show the DELETE is sent at flush.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.