Search Interview Questions
| More than 3000 questions in repository.|
There are more than 900 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|Ans. First resolution is a big No as it conveys no lazy loading in complete app. even second is advocating the same but for a particular mapping.|
third one is most appropriate if loading and dependent entity property access is closer to each other in code and can be accomplished.
I don't mind using 4th too.
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  lazy loading  lazy initialization  LazyInitializationException|
|What is Lazy Initialization in Hibernate ?|
|What are the ways to avoid LazyInitializationException ?|
|How to do Eager loading in Hibernate ?|
|After which Hibernate version , related Entities are initialized lazily ?|
| Which of the following do you think is the primary reason you would never use a static class even the application doesn't need multiple requests or threads ? |
b. Runtime Polymorphism
c. Lazy Loading
|What are the points to be considered if we move from Eager initialization to Lazy Initialization in Hibernate ?|
|How does Lazy Initialization helps improving performance of an application ?|
| What does the following exception means|
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
|Is it advisable to keep session or transaction open for long time just to avoid LazyInitializationException ?|