[hibernate-dev] [infinispan-dev] [ISPN-6] (Infinispan cache provider for Hibernate) Remaining TODOs, notes and questions

Manik Surtani manik at jboss.org
Fri Aug 7 08:06:57 EDT 2009


On 7 Aug 2009, at 12:51, Galder Zamarreno wrote:

> Manik,
>
> While I working on this, I've noted the following. If we define  
> default cache configurations for entity/query/...etc in an  
> infinispan configuration file, currently, they cannot be overriden  
> afterwards programatically.
>
> IOW, imagine there's a cache named "entity" that applies to all  
> entities in a sample infinispan-configs.xml and then someone tweaks  
> it in the hibernate config like this:
>
> hibernate.cache.infinispan.entity.eviction.wake_up_interval=3000
>
> The way I'd deal with this is that I'd create a Configuration with  
> this new interval and call defineCache("entity", cfg). However, when  
> the configuration file was processed, "entity" cache was added to  
> the configuration overrides and hence when I call defineCache with  
> "entity", it throws DuplicateCacheNameException.
>
> So, I think DFC.initialize() shouldn't add such configurations to  
> configuration overridesm map.
>
> Thoughts?

Hmm.  Perhaps what is needed is a mechanism to retrieve these  
configurations and alter them.  E.g.,

	CacheManager.getConfiguration(); // retrieves the default cfg
	CacheManager.getConfiguration(String name);

These Configuration objects - built based on what's in the XML file -  
can then be tweaked.  These should be adequately javadoc'd to make it  
clear that caches already started using such a configuration will not  
be affected when a configuration changes.

I guess this also renders CacheManager.defineCache() API useless/ 
obsolete, since getConfiguration() should always return a  
configuration, even if one didn't exist /wasn't defined in XML.

Cheers
Manik

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org







More information about the hibernate-dev mailing list