← Quiz: JPA and Hibernate: all 10 questions
Quiz: JPA and Hibernate · Question 7 of 10
Inside one transaction, the same course id is loaded twice. How many SELECT queries run?
Inside one transaction, the same course id is loaded twice. How many SELECT queries run?
- A.One, because Hibernate's first-level cache returns the already-loaded entity
- B.Two
- C.None
- D.One per field
Answer & explanation
Correct answer: One, because Hibernate's first-level cache returns the already-loaded entity
The persistence context keeps managed entities for the length of the 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 →