← Quiz: JPA and Hibernate: all 10 questions
Quiz: JPA and Hibernate · Question 4 of 10
Why does CourseService.update not call repository.save()?
Why does CourseService.update not call repository.save()?
- A.It forgot to save — the change is lost
- B.The entity is managed inside the transaction, so Hibernate saves the change at commit (dirty checking)
- C.PUT requests are never saved
- D.save() is called by the controller
Answer & explanation
Correct answer: The entity is managed inside the transaction, so Hibernate saves the change at commit (dirty checking)
Managed entities are tracked and flushed automatically.
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 →