File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes org.hibernate.LazyInitializationException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "org.hibernate.LazyInitializationException" Watch "org.hibernate.LazyInitializationException" New topic


Naufal kurudamparambil

Joined: Jan 03, 2012
Posts: 4
I am making one web application using struts 1.3 and hibernate I have changed not-null="false" in One to many relation in one class's hbm file, after that i got exception org.hibernate.LazyInitializationException

Claudiu Chelemen
Ranch Hand

Joined: Mar 25, 2011
Posts: 71

By default, hibernate uses lazy initialization.
Try adding lazy="false" to class declaration and check if it works.
If not, please post your mappings.

I agree. Here's the link:
subject: org.hibernate.LazyInitializationException