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: Object not using lazy loading, inefficient in bulk ops
PostPosted: Thu Sep 03, 2009 1:25 pm 
Newbie

Joined: Sun Jul 30, 2006 3:54 am
Posts: 10
Environment: VB.NET
.NET Framework version 1.1
NHibernate version 1.0.2.0

We've got an Employee object which has loads of other objects, lists etc. as its properties. We're not using lazy loading, and cannot switch to doing so easily.

The problem is that now we need to - in code - bulk process a load of Employee objects, making use of only a subset of its properties - many of those loaded from other tables in the database will not be used. We're finding performance is not good, mainly because of the numerous extra joins etc. being processed. (We've checked our indexes, and we're not getting any table scans - only index seeks/scans.)

The options I can see as a way round this are:

1. Turn off lazy loading temporarily (is this possible?)
2. Create another lightweight object with only the properties needed.
3. Write some custom SQL/HQL to pick the objects/data we need.

I'd be interested in suggestions!

Thanks,

James


Top
 Profile  
 
 Post subject: Re: Object not using lazy loading, inefficient in bulk ops
PostPosted: Fri Sep 04, 2009 8:42 am 
Newbie

Joined: Sun Jul 30, 2006 3:54 am
Posts: 10
I've gone for the option of creating a lightweight version of the object, with just the properties we need for the bulk processing.


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.