-->
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 Initialization not working on front-end
PostPosted: Tue May 24, 2005 1:57 am 
Newbie

Joined: Tue May 24, 2005 1:14 am
Posts: 6
Hi

I have this crazy problem.

I'm using Hibernate with Weblogic 8.1. Lazy initialization is turned on. I have a simple bean that has a list of related objects within it.

When I look up an object (using Criterias) and then do an Object.getRelatedObjects() call in my DAO layer, i get the related objects without a hitch. When I do the same thing on my JSP/JPF I get the object but not its related objects. The list of related objects is always returned null.

Is this because of lazy initialization??? I can't understand this behaviour.

Thanks in advance,
Rajiv


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 4:23 am 
Newbie

Joined: Tue Feb 15, 2005 5:25 am
Posts: 2
You need to initialise the objects which you want to use before the hibernate session is closed, otherwise the object cannot lazily initialise itself because the session is no longer present to provide the information to the object.

Calls such as Hibernate.initialize(...) can be used to force initiailisation of objects which you wish to use outside of a session.


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.