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: Caching: Many objects with collections point to the same row
PostPosted: Tue Jan 25, 2011 10:27 pm 
Newbie

Joined: Wed Jan 19, 2011 1:43 pm
Posts: 2
Hey folks,
I've got a bit of a performance problem, and I'm wondering if I can somehow configuring hibernate's caching or fetching to work with me better. Our database has a table with a column that holds a huge xml file that contains the configuration for the entire system (not my design). Many objects in the database have collections (Sets) mapped indicating the configuration record they are applied to. We only have a few system configuration rows, but thousands of other objects referencing them. At the moment, I'm trying to go through those other objects and update their system configuration sets. Each time I want to add an element to the set, hibernate has to materialize the other items in the set to compare with. So I end up with thousands of selects.

I've tried fetching all of those collections in an initial query, to get them all in cache. However, hibernate writes this query with a join through the system configuration table, and for every other object brings back the column with the huge xml configuration. So that query is dog slow. Really, hibernate only needs to grab the dozen or so (huge) configuration records, and then for each other (tiny) object figure out which one of the ones already in memory it points to by looking at the join table. But I can't get hibernate to act in this manner.

Any ideas?

Thanks so much!


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.