-->
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 with a seperate data layer
PostPosted: Wed May 25, 2005 7:24 am 
Newbie

Joined: Wed May 25, 2005 7:20 am
Posts: 3
Hi,

this is for a school project, due to be delivered way to soon so... any help would so be appreciated

thing is: i have a seperate data layer and domain layer

if i want to use nhib's lazy loading i need to have the same session

which i can do by opening a session, then disconnecting, and reconnecting and so on.. but i need to be able to reconnect when objects are (lazy) loaded and disconnect the session after the loading is complete..

is there an event i can subscribe to or a method i can override?

thx in advance!!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 1:40 am 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
well i'm guessing here but you might be able to write an interceptor, but in reality, you already know which collections are lazily loaded, so why can't you just re-open the session?

-devon


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 10:24 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You can also attach the entity to a new session using session.Lock(..., None)

So that you can open a new session when you need to initialize some other lazy-loaded collections/proxies.

But if you know that you will need them when loading the entity, you should initialize them at the same time.

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.