-->
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: Second-level caching of HQL aliases
PostPosted: Thu Oct 16, 2008 6:13 pm 
Beginner
Beginner

Joined: Fri May 06, 2005 2:37 pm
Posts: 39
We're using second-level caching with Hibernate, and LEFT JOIN FETCHing multiple collections, via aliases in HQL:

LEFT JOIN FETCH listing.secondaryTags tag
LEFT JOIN FETCH tag.keyphrases
LEFT JOIN FETCH tag.tagGroups

In monitoring our cache, it appears that the main objects are being cached properly, but keyphrases and tag groups are not being cached. Is this a limitation with hql aliases?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2008 3:37 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
At least as far as ehcache is concerned, you have to create another section in your ehcache.xml, mentioning the complete child path, for example:

Code:
    <cache name="for.example.Listing" maxElementsInMemory="8000"
           eternal="true" overflowToDisk="true" />

    <cache name="for.example.Listing.keyphrases" maxElementsInMemory="8000"
           eternal="true" overflowToDisk="true" />


    <cache name="for.example.Listing.tagGroups" maxElementsInMemory="8000"
           eternal="true" overflowToDisk="true" />

_________________
Gonzalo Díaz


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.