简体   繁体   中英

Configuring Infinispan as remote second level cache for Hibernate

As per Infinispan documentation the following settings make up setting infinispan as a L2 Cache provider for Entities

<property name="hibernate.cache.use_second_level_cache" value="true" />   
<property name="hibernate.cache.use_query_cache" value="true" />  
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.InfinispanRegionFactory"/>

Then further one can annotate Entities with @javax.persistence.Cacheable to make them candidate for L2 cache.

My question is how to make this a remote cache ?

Infinispan 2LC implementation for remote cache does not exist. You could maybe configure the embedded caches used for Infinispan 2LC with a remote cache store which talks to one or multiple Infinispan Servers. Please note that this has not been tested and there's no guarantees that it'll work as expected due to the peculiarities and the optimizations done by the embedded Infinispan 2LC implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM