[hibernate-dev] lookup of Infinispan cachemanager for Search's own dirty reasons

Paul Ferraro paul.ferraro at redhat.com
Tue Nov 16 13:47:22 EST 2010


On Tue, 2010-11-16 at 17:25 +0000, Sanne Grinovero wrote:
> Hi,
> I see that the Infinispan second level cache defines a nice property
> "hibernate.cache.infinispan.cachemanager" to search an existing
> CacheManager via JNDI.
> 
> Now in case of Hibernate Search's DirectoryProvider making use of
> Infinispan, I suppose that people will want to lookup the same
> CacheManager,
> which then would be used for both purposes, even if very likely the
> configuration will contain different caches for each use case.
> 
> So from Hibernate Search's new module, shall I look for the same
> property? The "cache" part in the name is unfortunate, still I would
> like to define it just once.
> 
> Ideas>
> 
> 1 - add a new property "hibernate.infinispan.jndiname", and have the
> 2LC look for this as fallback, I'll look for the same
> 
> 2 - I suppose JBoss6 will bind it to JNDI by default

Yes, in AS6, the jndi name to which the hibernate 2LC cache manager is
bound is defined in the following file:
$JBOSS_HOME/server/all/cluster/deploy/infinispan-cache-registry.sar/infinispan-configs.xml

in the section that defines the hibernate 2LC cache configurations:
<infinispan-config name="hibernate" jndi-name="java:CacheManager/entity">
  ...
</infinispan-config>

> , could we use
> this name as default in Hibernate to bring configuration need to the
> minimum?
> In that case I'd love to add some cache configurations for the dirty
> purposes of Hibernate Search in the AS distribution, so that stuff
> works with minimal configuration hazards.

These can be added as individual <namedCache/> configuration entries
within the config block described above.

> Cheers,
> Sanne
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev





More information about the hibernate-dev mailing list