-->
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 whole lookup table in HashMap efficiently
PostPosted: Wed May 23, 2007 8:25 am 
Newbie

Joined: Tue May 22, 2007 5:51 am
Posts: 2
I posted it in a different thread without any replies (http://forum.hibernate.org/viewtopic.php?t=974833&highlight=), so I try it here.

I couldn't find any information in the book how to cache root entries. I know how to cache objects referenced by others (sets, joins), and also how to cache results. But I want to read a whole table with one select and access the entries with maximum speed e.g. from a HashMap<ArrayList<c>>.

The (legacy) lookup table has two columns (a, b), and a third "result" column (c). There are lots of different a/b-combinations, and a/b is not a primary key, which means there may be many c's for any given a/b.

Example:

ArrayList<c> lookupValues=map.get(createKey(a, b))

The solutions I evaluated so far generate lots of selects (one for any a/b combination), which is prohibitive for performance reasons.

Is there any better solution with Hibernate? How can I instruct Hibernate to cache all *root* objects for a table?

Thanks a lot!


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.