> On 23 Feb 2015, at 18:23, Sebastian Łaskawiec <[email protected]> 
> wrote:
> 
> Hey!
> 
> I've noticed an interesting question on StackOverflow [1]. Is it possible to 
> have 2 (or more) caches and associate database tables to specific caches? I 
> can even imagine this question in broader perspective - is it possible to 
> decide in the runtime, which cache should be used? 
> 
> After a short discussion with Sanne we couldn't find any solution. Does 
> anyone have any idea how to achieve this or maybe we have a "New Feature 
> Request" candidate?

By default, each entity and collection is stored in its own cache. These caches 
are configured from a template cache. For entities, the template cache 
configuration is "entity" and for collections, "collection".

It is possible that users might want to use different cache configuration per 
entity and/or collection, e.g. for different expiration, lifespan settings and 
other potential changes. The most common thing to tweak is expiration, which is 
why we made these specific expiration changes easy to do.

However, if you want to change other things, like lifespan or max idle 
settings, you need to define your own cache configuration and then assign the 
cache name to the entity that you want.

All of this is explained in 
http://infinispan.org/docs/7.1.x/user_guide/user_guide.html#_advanced_configuration_2,
 including the different tweaks required in the property names when running 
inside Wildfly or EAP.

Cheers,

> 
> Thanks
> Sebastian
> 
> [1] 
> http://stackoverflow.com/questions/28668971/hibernate-different-caches-for-different-tables
> _______________________________________________
> infinispan-dev mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


--
Galder Zamarreño
[email protected]





_______________________________________________
infinispan-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/infinispan-dev

Reply via email to