Hi Sanne,

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 [1] ("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 
[1].

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?

Cheers,

[1] 
http://infinispan.org/docs/7.2.x/user_guide/user_guide.html#_advanced_configuration_2

> Date: Mon, 1 Jun 2015 19:24:33 +0100
> From: Sanne Grinovero <sa...@hibernate.org>
> Subject: [hibernate-dev] 2nd level cache tuning on WildFly
> To: "Hibernate.org" <hibernate-dev@lists.jboss.org>
> Message-ID:
>       <cafm4xo29-w2bfg4k2lbpkd2mzfv2s174hq2fy5mcnha5q96...@mail.gmail.com>
> 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:
> https://docs.jboss.org/author/display/WFLY9/JPA+Reference+Guide#JPAReferenceGuide-UsingtheInfinispansecondlevelcache
> 
> 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,
> Sanne
> 
--
Galder Zamarreño
gal...@redhat.com





_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to