-->
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.  [ 3 posts ] 
Author Message
 Post subject: lazy loading, when session is closed
PostPosted: Wed Sep 21, 2005 12:14 am 
Newbie

Joined: Tue Sep 13, 2005 2:18 am
Posts: 2
I encapsulate nHibernate operation at DAL. And after every operation i close the session( i think it's recommended session-per-request).

So at the Business Logical Layer, when i get an object, the object's lazy-loaded property can't be accessed( such as bag/set collection).

which is the best practice at this scenario?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 11:28 am 
Beginner
Beginner

Joined: Wed Oct 05, 2005 5:35 am
Posts: 47
Location: France
I guess that can be of some use: http://wiki.nhibernate.org/display/NH/Lazy+Loading+Topics


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 2:47 pm 
Newbie

Joined: Thu Sep 08, 2005 12:15 pm
Posts: 17
You can open the session in the get or set method of the property that you want to lazy load by calling a OpenSession Method and a CloaseSession method in your Dal.

But IMO the session-per-request method is better...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.