-->
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: Natural key second level cache
PostPosted: Mon Feb 22, 2010 6:03 am 
Newbie

Joined: Fri Nov 26, 2004 5:11 am
Posts: 5
Is it possible to set up the second level cache to be indexed by a natural key rather than the primary key? We have objects with an auto generated Id, but which are accessed by name primarily - thus the second level cache is bypassed.

I have a relatively small number of very slow moving objects (config type data - approx 100 objects in total) which is accessed very frequently. By using a hand cranked cache I see the performance improvements I am after, but I'd much prefer to do things by the book.

I have tried using the query cache but this had a significantly detrimental affect on the performance (it would seem to be spending a lot of time invalidating tables which I do not use for query caching).

Any assistance would be appreciated - either to understand how best to use query cache or ideally how to access the second level cache in a different manner.

Thanks.


Top
 Profile  
 
 Post subject: Re: Natural key second level cache
PostPosted: Mon Feb 22, 2010 6:30 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
It is not possible with the current Hibernate version, but I think the developers are working on something that is planned to appear in 3.6. See

http://opensource.atlassian.com/project ... e/HHH-2896
http://opensource.atlassian.com/project ... e/HHH-2879


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.