-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: LazyInitializationException
PostPosted: Wed Jan 25, 2006 12:52 am 
Newbie

Joined: Tue Jan 24, 2006 5:45 am
Posts: 3
Hi.. when iam calling a hibernate classs from my program
iam getting LazyInitializationException..
can any one help me out...
Thx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 6:04 am 
Senior
Senior

Joined: Tue May 10, 2005 9:00 am
Posts: 125
You are most probably trying to access the content of uninitialised persisted objects while the session has already been close by a call to session.close();

Solution 1: close the session *after* you are finished using you object
Solution 2: ensure objects you are going to use are initialised
Solution 3: disable lazy initialisation in .hbm


Solution 1 is preferred, Solution 3 can have serious performances issues.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.