-->
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: lazy-load needs a session during the whole app-time?
PostPosted: Tue Dec 04, 2007 9:04 am 
Newbie

Joined: Thu Nov 15, 2007 9:52 am
Posts: 8
This works fine:
I open the session,
initialize the GUI with the data from the DB and then
I close the session - as shown in the examples.


But when I activate lazy-loading the following happens:
The initialization of the GUI as described above works and no errors are shown.
But when I access some child-objects which should get loaded lazy I get the 'LazyInitializationException'.

Will I need to have an opened session during the whole application-lifetime? Or is there another way to use lazy-loading?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 04, 2007 12:35 pm 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Hi,

You will have to initialize the child in the same session, else you will have the LazyInitializationException.

i.e)
If you want the child in the screen1, load the child along with the parent.

If you feel that in page1 parent object is enough and in page2 you are required to show child object..call ur backend to load the parent with child.

Hope this helps:-)

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


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.