By default, each entity gets its own cache in both standalone and WF. WF might only expose
the configuration for "entity" cache, but internally, each entity gets a new
cache that has the configuration of "entity".
If you want for a particular entity type to have different cache settings, you might be
able to modify them directly in the Hibernate configuration itself via properties 
("hibernate.cache.infinispan.cfg" would not apply within WF)
Otherwise, right now yeah, you'd need to define a cache in the persistence cache
container, and assign that cache name to your entity, again defined in .
For standalone envs, you can reference the XML from the Hibernate configuration, but yeah,
I see your point of having an easier way to define the cache from the deployment
configuration itself. This could potentially done in such way that can be used for both
standalone and WF. Can you create an HHH for this?
Date: Mon, 1 Jun 2015 19:24:33 +0100
From: Sanne Grinovero <sanne(a)hibernate.org>
Subject: [hibernate-dev] 2nd level cache tuning on WildFly
To: "Hibernate.org" <hibernate-dev(a)lists.jboss.org>
Content-Type: text/plain; charset=UTF-8
Does someone have an example of how I could use different Infinispan
Cache(s) for each of my Hibernate entities?
The WildFly documentation doesn't get much into tuning:
I'd like to define Cache configuration in the WildFly configuration
file and map them 1:1 to the cacheable entities.
Which also brings up the question on why I should edit the root
configuration for sake of app-specific details.. ideally I'd want to
add such a configuration snippet within my application deployment.
thanks in advance for any pointer,