This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes LazyInitializationException Help please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "LazyInitializationException Help please" Watch "LazyInitializationException Help please" New topic
Author

LazyInitializationException Help please

Milan Djukic
Greenhorn

Joined: Feb 14, 2011
Posts: 27
Hi all.

Please help me, this is killing me

I have two classes A and B.





And when i call find method of class EntityManager find(A.class,id) i get a org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: ......

How can i solve this, this is really killing me



kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1399
change lazy to eager fetching strategy.
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1399
Make sure Hibernate session is used after session is closed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LazyInitializationException Help please
 
It's not a secret anymore!