[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5260) Tweak for query-cache via hibernate.hbm.xml needed

Galder Zamarreno (JIRA) noreply at atlassian.com
Wed May 26 03:08:55 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37275#action_37275 ] 

Galder Zamarreno commented on HHH-5260:
---------------------------------------

Nikita, I'm still confused by your comments. WRT the following comment: " I migrated to infinispan in my application and noticed that cache configurations for different queries not loaded at all.". Could you show the hibernate.cfg.xml and jboss cache configuration file that you were using for this?

I think there's misunderstanding going on here about regions and cache instances. Both JBossCache and Infinispan layers have always stored all queries under the same cache instance. The code change that you suggest results in queries for different regions being stored in different cache instances.

What JBoss Cache used to do is use the region of a query to form the FQN under which the query was stored within the shared cache instance for all queries. In Infinispan, this region name is ignored and the query key is simply used as key in the cache itself.

What I'm trying to understand is what is it that you're trying to gain out of having a different cache instance for each query region? Is it setting different eviction settings for each query region? The main advantage of using region names in the old JBoss Cache module is that you could then go to the jboss cache config file and set evictions for the specific FQN for the query region specified. 

To be able to do something similar with Infinispan yeah, we'd need to implement a change similar to what you suggest, where each query is stored under a cache instance with that region name. You'd then be able maxEntries, lifespan...etc and other type of eviction settings for that particular region.

Again, please explain in more detail what is it that you're unable to do right now.

> Tweak for query-cache via hibernate.hbm.xml needed
> --------------------------------------------------
>
>                 Key: HHH-5260
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5260
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: caching (L2)
>            Reporter: Galder Zamarreno
>            Assignee: Galder Zamarreno
>
> From Niktia Koksharov in https://jira.jboss.org/browse/ISPN-458:
> "In current implementation of hibernate-infinispan we can tune only entity and collection settings via hibernate.xml.cfg. But tuning in same way for queries needed too. In current version there are always the same cache region for all queries (look at org.hibernate.cache.infinispan.InfinispanRegionFactory.buildQueryResultsRegion) and it's incorrect. 
> In org.hibernate.cache.infinispan.InfinispanRegionFactory.buildQueryResultsRegion 
> Replace those lines: 
>         String cacheName = typeOverrides.get(QUERY_KEY).getCacheName(); 
>         CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(manager.getCache(cacheName)); 
> To: 
>         Cache cache = getCache(regionName, QUERY_KEY, properties); 
>         CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(cache); "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list