← 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?
- A.The UPDATE runs at once
- B.Hibernate throws an exception immediately
- C.The change is saved at the next startup
- 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 →