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

Galder Zamarreño galder at jboss.org
Wed Nov 17 06:21:19 EST 2010

On Nov 16, 2010, at 6:25 PM, 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.

Hmmm, not so sure about that actually. 

Your cache manager and the 2LC one have different purposes and can you guarantee that your app won't end up using a 2LC cache by mistake? You'd need to have some kind of knowledge of the cache naming there. 

So, -1 to this.

> 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

No, you need your own property. Why not start naming it with hibernate.search.X and that way you avoid collisions with other hibernate properties?

> 2 - I suppose JBoss6 will bind it to JNDI by default, could we use
> this name as default in Hibernate to bring configuration need to the
> minimum?

JBoss6 uses different cache managers, not just one: i.e. WebSessions, 2LC, EJb3SFSB, so I doubt there's a single JNDI name there.

> 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.
> Cheers,
> Sanne
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache

More information about the hibernate-dev mailing list