🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: JPA and Hibernate: all 10 questions

Quiz: JPA and Hibernate · Question 8 of 10

An entity was loaded in a transaction that has now ended. Its title is changed. What happens?

An entity was loaded in a transaction that has now ended. Its title is changed. What happens?

  1. A.The UPDATE runs at once
  2. B.Hibernate throws an exception immediately
  3. C.The change is saved at the next startup
  4. D.Nothing is saved, because the entity is detached and no longer tracked
Answer & explanation

Correct answer: Nothing is saved, because the entity is detached and no longer tracked

Dirty checking only works for managed entities inside a transaction.

Can you get the rest right without peeking?

Take the timed Quiz: JPA and Hibernate quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →