-->
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.  [ 1 post ] 
Author Message
 Post subject: SQL - massive outer joins on list properties
PostPosted: Wed Jul 22, 2009 8:09 am 
Newbie

Joined: Wed Jul 22, 2009 7:41 am
Posts: 1
Hi there - I was hoping someone could shed some light on a scalability problem I have with NH?

Legacy system using NH 1, with a large inheritance structure. Essentially there's:

Core layer (where all objects are first defined)
Customer layer (where we add in cross product functionality)
Product layer (specific product implementations of the objects)

there are currently 17 products - each with their multiple layers of inheritance within themselves.

Example:

CoreUser is implemented by CustomerUser is implemented by ProductAUser (there's also multiple classes in ProductA which inherit from ProductAUser, e.g. ProductAGuestUser, ProductAAdminUser, ProductAReadonlyUser etc)

ProductA has no concept of products b, c and d etc

They all use the same session / session factory (so the mappings for all products have been read in).

There's also another core class (CoreLocation) which implements a .Users property which returns a list of the users associated with that Site. This is also implemented on the various layers. (so - there's a ProductALocation class)

Problem comes here: ProductALocation.Users causes sql to be executed that covers all mappings for all products and layers using outer joins.

Is there some way of implementing some sort of type restriction at the product layer which will restrict the sql that's executed when CoreLocation.Users is called? I know that, for a give product, the types that can be on Product?Location.User list are either CoreUser, CustomerUser or Product?User (and it's implementations) - I dont want to look for B and C and D product users...

This particular problem is causing us MASSIVE performance problems - the queries that are being executed are 5000+ lines long and causing timeouts.

Thanks in advance for any help (even if it's RTFM!) or suggestions as to manual chapters that I should review - surely I cant be the only person on the planet to be getting these problems?

Andy

PS - this is a legacy system which cannot be changed to a vast degree - I didn't sling it together in the first place - I'm just the poor sap that's been tasked with eliminating this particular problem!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.