← Quiz: Relationships and Transactions: all 10 questions
Quiz: Relationships and Transactions · Question 5 of 10
What causes LazyInitializationException?
What causes LazyInitializationException?
- A.Too many entities in memory
- B.Accessing a lazy relationship after the transaction/session has closed
- C.A missing @Id
- D.Using FetchType.EAGER
Answer & explanation
Correct answer: Accessing a lazy relationship after the transaction/session has closed
Load what you need inside the transaction.
Can you get the rest right without peeking?
Take the timed Quiz: Relationships and Transactions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →