My app is using both hibernate 2nd level cache and Spring cache abstraction. Is there a way to configure them to share the same instance of the hazelcast client? any help would be greatly appreciated
public Properties jpaProperties() {
Properties properties = new Properties();
properties.put("hibernate.cache.region_prefix", dsContext.substring(1)+"#L2Cache");
properties.put("javax.persistence.sharedCache.mode","ENABLE_SELECTIVE");
//properties.put("hibernate.generate_statistics", "true");
properties.put("hibernate.cache.use_second_level_cache", "true");
properties.put("hibernate.cache.use_minimal_puts", "true");
properties.put("hibernate.cache.region.factory_class", "com.hazelcast.hibernate.HazelcastCacheRegionFactory");
properties.put("hibernate.cache.hazelcast.use_native_client", "true");
return properties;
}
@Bean
public CacheManager cacheManager() {
ClientConfig config = new ClientConfig();
config.getNetworkConfig()
HazelcastInstance client = HazelcastClient.newHazelcastClient(config);
return new HazelcastCacheManager(client);
}