-->
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.  [ 4 posts ] 
Author Message
 Post subject: Mapping Q: Frequently used class with large text fields
PostPosted: Wed Sep 20, 2006 12:47 pm 
Beginner
Beginner

Joined: Wed Jun 08, 2005 4:59 pm
Posts: 27
I am moving a large existing app to NHibernate. There is a person class that is used throughout the application and needs to be performant. This class has a handful of properties (think things like resume) which are large chunks of text that are used in just a handful of instances. However, because NH mapping includes them, contents of these fields are always loaded and this is quantifiably affecting the performance of the app.

Is there a way to lazy load properties? If not, any other ways to handle this?

Thanks!
-MT


Top
 Profile  
 
 Post subject: Re: Mapping Q: Frequently used class with large text fields
PostPosted: Wed Sep 20, 2006 1:44 pm 
Beginner
Beginner

Joined: Wed Aug 03, 2005 8:06 am
Posts: 40
Location: Netherlands
mteper wrote:
Is there a way to lazy load properties?

Do you mean that mapping the Person class as lazy="true" does not help, or didn't you use this option so far?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 5:50 pm 
Beginner
Beginner

Joined: Wed Jun 08, 2005 4:59 pm
Posts: 27
My understanding is that mapping Person as lazy would make references to the person object lazy. What is need is to have references to *properties* of the object to behave lazy. So that in 99% of the cases certain fields will not get pulled in and saved but when I reference them, a call will be made to get the data.

Hope that made sense.

-MT

P.S. Can a class be extended w/o using a discriminator? In other words, if I were to have a SimplePerson and an inheriting Person with a handful or extra fields, would that achieve what I'm after?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 6:27 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
I'm not sure if this works, but it's worth a shot:

What about components?

Make the large text columns components using a separate class, and mark those as lazy. With components they still map to the same table, but they are separate classes.

If this doesn't work then I'd avoid using NHibernate for the resume portion and just roll my own ADO code for that one, using lazy loading. Sucks, but it's better than fetching all that data every time.

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


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