-->
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: .NET Remoting and Lazy Loading
PostPosted: Sun Sep 04, 2005 5:05 am 
Newbie

Joined: Sun Sep 04, 2005 4:55 am
Posts: 1
Say I have an object User which has an IList (mapped/lazy loaded by nHibernate) Friends. If I have a remotable object that has a method that returns this User object:
a- I assume on calling this method that the User object being returned will not have the Friends list populated. Am I correct?
b- If I access (on the client) User.Friends[0] how can I make sure the remotable object is called so that nHibernate can start loading the object I'm trying to access?

Thank you,
Sammy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 1:26 pm 
user class is marshall byvalue or marshallbyref (remote object) ?
marshallbyref will load the friends as lazy load.
marshallbyvalue will not load.

if i am wrong, someone correct me.


Top
  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 4:18 pm 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
i havent tried yet, but joew should be right. The marshal by ref will do everything automatically.

however, it is not considered good practise to create lots of remote objects. Are you sure that is how you wish to work?

I would suggest fetching everything that you need before you go to your client (this is sometimes faster then going through all your layers to populate the friends list)

or

create your own ISession implementor that will just direct all your calls directly to your real session object, but first go to your server.


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.