Skip to content

Commit a458dda

Browse files
rica-v3rica.rdo
andauthored
[Issues 7] ReadWriteAccessDomainDataStorageAccess not to evict SoftLock when cacheEvictOnCachePut (#10)
* Override ReadWriteAccessDomainDataStorageAccess.evictDataOnRegionGroupCacheEvict not to evict current cache items are locked * Overload HibernateArcusStorageAccess.getFromCache * Remove HibernateArcusStorageAccess.release() not to override * Override release() with empty body in HibernateArcusStorageAccess * Delete enableCacheEvictOnCachePut config prop from HibernateArcusStorageConfig * Rename prop .regionGroupOnCacheEvict to .evictionRegionGroupOnCacheUpdate * Add HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_EVICTION_REGION_GROUP_ON_CACHE_UPDATE * Move all the property key string to HibernateArcusProperties * Modify const value of HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_EVICTION_REGION_GROUP_ON_CACHE_UPDATE * Update README.md (.domainData.evictionRegionGroupOnCacheUpdate added) Co-authored-by: rica.rdo <rica.rdo@kakaopaycorp.com>
1 parent 1df0711 commit a458dda

11 files changed

+73
-67
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,14 @@ gradlew clean test --info
102102
```
103103
---
104104

105-
### Configuratio Properties
105+
### Additional Configuration Properties
106106
```
107107
hibernate.cache.arcus.fallbackEnabled (default: true) // whether to use fallback mode or not.
108108
hibernate.cache.arcus.initFallbackMode (default: false) // Initial value of fallback mode
109109
hibernate.cache.arcus.reconnectIntervalInSec (default: 10000) unit mills // ArcusClient retry connection interval in seconds
110110
hibernate.cache.arcus.opTimeout (default 10000) unit mills // arcus client cache operation timeout.
111111
hibernate.cache.arcus.healthCheckIntervalInSec(default 10) unit sec // interval time of health check
112+
hibernate.cache.arcus.domainData.evictionRegionGroupOnCacheUpdate(default "") // domain data region group to be evicted on cache update
112113
```
113114

114115
### Contribution
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.devookim.hibernatearcus.config;
22

33
import lombok.extern.slf4j.Slf4j;
4-
import net.spy.memcached.*;
4+
import net.spy.memcached.ArcusClient;
5+
import net.spy.memcached.ArcusClientPool;
6+
import net.spy.memcached.ConnectionFactoryBuilder;
57

68
import java.util.Map;
79

@@ -16,25 +18,25 @@ public class ArcusClientConfig {
1618
private final String serviceCode;
1719

1820
public ArcusClientConfig(Map<String, String> properties) {
19-
this.host = properties.getOrDefault("hibernate.cache.arcus.host", "localhost:2181");
20-
this.serviceCode = properties.getOrDefault("hibernate.cache.arcus.serviceCode", "");
21-
this.poolSize = Integer.parseInt(properties.getOrDefault("hibernate.cache.arcus.poolSize", "1"));
22-
this.fallbackEnabled = Boolean.parseBoolean(properties.getOrDefault("hibernate.cache.arcus.fallbackEnabled", "true"));
23-
this.initFallbackMode = Boolean.parseBoolean(properties.getOrDefault("hibernate.cache.arcus.initFallbackMode", "false"));
24-
this.healthCheckIntervalInSec = Integer.parseInt(properties.getOrDefault("hibernate.cache.arcus.healthCheckIntervalInSec", "10"));
21+
this.host = properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_HOST, "localhost:2181");
22+
this.serviceCode = properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_SERVICE_CODE, "");
23+
this.poolSize = Integer.parseInt(properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_POOL_SIZE, "1"));
24+
this.fallbackEnabled = Boolean.parseBoolean(properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_FALLBACK_ENABLED, "true"));
25+
this.initFallbackMode = Boolean.parseBoolean(properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_INIT_FALLBACK_MODE, "false"));
26+
this.healthCheckIntervalInSec = Integer.parseInt(properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_HEALTH_CHECK_INTERVAL_IN_SEC, "10"));
2527
this.properties = properties;
2628
}
2729

2830
public ArcusClientPool createArcusClientPool() {
2931
log.info("Creating arcus client pool");
3032
ConnectionFactoryBuilder cfb = new ConnectionFactoryBuilder();
31-
cfb.setMaxReconnectDelay(Long.parseLong(properties.getOrDefault("hibernate.cache.arcus.reconnectIntervalInSec", "10000")));
32-
cfb.setOpTimeout(Long.parseLong(properties.getOrDefault("hibernate.cache.arcus.opTimeout", "10000")));
33+
cfb.setMaxReconnectDelay(Long.parseLong(properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_RECONNECT_INTERVAL_IN_SEC, "10000")));
34+
cfb.setOpTimeout(Long.parseLong(properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_OP_TIMEOUT, "10000")));
3335
return ArcusClient.createArcusClientPool(
3436
host,
3537
serviceCode,
3638
cfb,
3739
poolSize
3840
);
3941
}
40-
}
42+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.devookim.hibernatearcus.config;
2+
3+
public class HibernateArcusProperties {
4+
public static final String HIBERNATE_CACHE_ARCUS_HOST = "hibernate.cache.arcus.host";
5+
public static final String HIBERNATE_CACHE_ARCUS_SERVICE_CODE = "hibernate.cache.arcus.serviceCode";
6+
public static final String HIBERNATE_CACHE_ARCUS_POOL_SIZE = "hibernate.cache.arcus.poolSize";
7+
public static final String HIBERNATE_CACHE_ARCUS_FALLBACK_ENABLED = "hibernate.cache.arcus.fallbackEnabled";
8+
public static final String HIBERNATE_CACHE_ARCUS_INIT_FALLBACK_MODE = "hibernate.cache.arcus.initFallbackMode";
9+
public static final String HIBERNATE_CACHE_ARCUS_HEALTH_CHECK_INTERVAL_IN_SEC = "hibernate.cache.arcus.healthCheckIntervalInSec";
10+
public static final String HIBERNATE_CACHE_ARCUS_RECONNECT_INTERVAL_IN_SEC = "hibernate.cache.arcus.reconnectIntervalInSec";
11+
public static final String HIBERNATE_CACHE_ARCUS_OP_TIMEOUT = "hibernate.cache.arcus.opTimeout";
12+
public static final String HIBERNATE_CACHE_ARCUS_EVICTION_REGION_GROUP_ON_CACHE_UPDATE = "hibernate.cache.arcus.domainData.evictionRegionGroupOnCacheUpdate";
13+
}

src/main/java/com/devookim/hibernatearcus/config/HibernateArcusStorageConfig.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66

77
public class HibernateArcusStorageConfig {
88

9-
public final boolean enableCacheEvictOnCachePut;
10-
public final HashSet<String> regionGroupOnCacheEvict;
9+
public final HashSet<String> evictionRegionGroupOnCacheUpdate;
1110

1211
public HibernateArcusStorageConfig(Map<String, String> properties) {
13-
enableCacheEvictOnCachePut = Boolean.parseBoolean(properties.getOrDefault("hibernate.cache.arcus.enableCacheEvictOnCachePut", "false"));
14-
regionGroupOnCacheEvict = new HashSet<>();
15-
Collections.addAll(regionGroupOnCacheEvict, properties.getOrDefault("hibernate.cache.arcus.regionGroupOnCacheEvict", "").split(","));
12+
evictionRegionGroupOnCacheUpdate = new HashSet<>();
13+
Collections.addAll(evictionRegionGroupOnCacheUpdate, properties.getOrDefault(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_EVICTION_REGION_GROUP_ON_CACHE_UPDATE, "").split(","));
1614
}
1715
}

src/main/java/com/devookim/hibernatearcus/storage/DomainDataHibernateArcusStorageAccess.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public Object getFromCache(Object key, SharedSessionContractImplementor session)
4747
@Override
4848
public void putIntoCache(Object key, Object value, SharedSessionContractImplementor session) {
4949
if (accessType != AccessType.READ_WRITE
50-
&& storageAccessConfig.enableCacheEvictOnCachePut
50+
&& storageAccessConfig.evictionRegionGroupOnCacheUpdate.contains(CACHE_REGION)
5151
&& contains(key)) {
5252
log.debug("enableCacheEvictOnCachePut enabled. key: {}", key);
5353
evictData(key);
@@ -63,10 +63,9 @@ && contains(key)) {
6363

6464
@Override
6565
public void evictData(Object key) {
66-
if (storageAccessConfig.enableCacheEvictOnCachePut
67-
&& storageAccessConfig.regionGroupOnCacheEvict.contains(CACHE_REGION)) {
66+
if (storageAccessConfig.evictionRegionGroupOnCacheUpdate.contains(CACHE_REGION)) {
6867
String id = key.toString().split("#")[1];
69-
log.debug("regionGroupOnCacheEvict contains region: {}, id: {}", CACHE_REGION, id);
68+
log.debug("evictionRegionGroupOnCacheUpdate contains region: {}, id: {}", CACHE_REGION, id);
7069
domainDataStorageAccesses.forEach((region, storageAccess) ->
7170
storageAccess.evictDataOnRegionGroupCacheEvict(new HibernateArcusCacheKeysFactory.EntityKey(storageAccess.entityClassName, id)));
7271
} else {
@@ -75,8 +74,8 @@ public void evictData(Object key) {
7574
}
7675

7776
public void evictDataOnRegionGroupCacheEvict(Object key) {
78-
if (storageAccessConfig.regionGroupOnCacheEvict.contains(CACHE_REGION)) {
79-
log.debug("cacheEvict {} by regionGroupOnCacheEvict", key);
77+
if (storageAccessConfig.evictionRegionGroupOnCacheUpdate.contains(CACHE_REGION)) {
78+
log.debug("cacheEvict {} by evictionRegionGroupOnCacheUpdate", key);
8079
super.evictData(key);
8180
}
8281
}

src/main/java/com/devookim/hibernatearcus/storage/HibernateArcusStorageAccess.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ protected String generateKey(Object key) {
2323

2424
@Override
2525
public Object getFromCache(Object key, SharedSessionContractImplementor session) {
26+
return getFromCache(key);
27+
}
28+
29+
protected Object getFromCache(Object key) {
2630
if (arcusClientFactory.isFallbackModeOn()) {
2731
log.info("Fallback is on key: {}", key);
2832
return null;
@@ -121,11 +125,5 @@ public void evictData(Object key) {
121125

122126
@Override
123127
public void release() {
124-
try {
125-
log.debug("release region:{}", CACHE_REGION);
126-
this.arcusClientFactory = null;
127-
} catch (Exception e) {
128-
throw new CacheException(e);
129-
}
130128
}
131129
}

src/main/java/com/devookim/hibernatearcus/storage/ReadWriteAccessDomainDataStorageAccess.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.devookim.hibernatearcus.factory.HibernateArcusCacheKeysFactory;
66
import lombok.extern.slf4j.Slf4j;
77
import org.hibernate.cache.cfg.spi.DomainDataRegionConfig;
8-
import org.hibernate.cache.spi.support.AbstractReadWriteAccess;
8+
import org.hibernate.cache.spi.access.SoftLock;
99
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1010
import org.hibernate.resource.transaction.spi.TransactionStatus;
1111

@@ -20,8 +20,8 @@ public ReadWriteAccessDomainDataStorageAccess(HibernateArcusClientFactory arcusC
2020

2121
@Override
2222
public void putIntoCache(Object key, Object value, SharedSessionContractImplementor session) {
23-
if (storageAccessConfig.enableCacheEvictOnCachePut
24-
&& value instanceof AbstractReadWriteAccess.SoftLockImpl
23+
if (storageAccessConfig.evictionRegionGroupOnCacheUpdate.contains(CACHE_REGION)
24+
&& value instanceof SoftLock
2525
&& isTransactionActive(session)) {
2626
log.debug("enableCacheEvictOnCachePut enabled. key: {}", key);
2727
evictData(key);
@@ -31,10 +31,9 @@ && isTransactionActive(session)) {
3131

3232
@Override
3333
public void evictData(Object key) {
34-
if (storageAccessConfig.enableCacheEvictOnCachePut &&
35-
storageAccessConfig.regionGroupOnCacheEvict.contains(CACHE_REGION)) {
34+
if (storageAccessConfig.evictionRegionGroupOnCacheUpdate.contains(CACHE_REGION)) {
3635
String id = key.toString().split("#")[1];
37-
log.debug("regionGroupOnCacheEvict contains region: {}, id: {}", CACHE_REGION, id);
36+
log.debug("evictionRegionGroupOnCacheUpdate contains region: {}, id: {}", CACHE_REGION, id);
3837
domainDataStorageAccesses.forEach((region, storageAccess) -> {
3938
if (!region.equals(CACHE_REGION)) {
4039
storageAccess.evictDataOnRegionGroupCacheEvict(new HibernateArcusCacheKeysFactory.EntityKey(storageAccess.entityClassName, id));
@@ -45,6 +44,14 @@ public void evictData(Object key) {
4544
}
4645
}
4746

47+
@Override
48+
public void evictDataOnRegionGroupCacheEvict(Object key) {
49+
if (getFromCache(key) instanceof SoftLock) {
50+
return;
51+
}
52+
super.evictDataOnRegionGroupCacheEvict(key);
53+
}
54+
4855
private boolean isTransactionActive(SharedSessionContractImplementor session) {
4956
return session.getTransaction() != null
5057
&& session.getTransaction().getStatus().equals(TransactionStatus.ACTIVE);

src/test/java/com/devookim/hibernatearcus/client/HibernateArcusClientFactoryTest.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.util.HashMap;
77

8+
import static com.devookim.hibernatearcus.config.HibernateArcusProperties.*;
89
import static org.junit.Assert.assertFalse;
910
import static org.junit.Assert.assertTrue;
1011

@@ -13,13 +14,13 @@ public class HibernateArcusClientFactoryTest {
1314
@Test
1415
public void testHealthCheckArcusCluster_whenFallbackModeIsOn_andWhenArcusClusterIsAvailable_thenFallbackModeTurnsOffAfterHealthCheck() throws InterruptedException {
1516
HashMap<String, String> properties = new HashMap<>();
16-
properties.put("hibernate.cache.arcus.host", "localhost:12181");
17-
properties.put("hibernate.cache.arcus.serviceCode", "test");
18-
properties.put("hibernate.cache.arcus.initFallbackMode", "true");
19-
properties.put("hibernate.cache.arcus.healthCheckIntervalInSec", "1");
17+
properties.put(HIBERNATE_CACHE_ARCUS_HOST, "localhost:12181");
18+
properties.put(HIBERNATE_CACHE_ARCUS_SERVICE_CODE, "test");
19+
properties.put(HIBERNATE_CACHE_ARCUS_INIT_FALLBACK_MODE, "true");
20+
properties.put(HIBERNATE_CACHE_ARCUS_HEALTH_CHECK_INTERVAL_IN_SEC, "1");
2021
HibernateArcusClientFactory sut = new HibernateArcusClientFactory(new ArcusClientConfig(properties));
2122
assertTrue(sut.isFallbackModeOn());
22-
23+
2324
Thread.sleep(1500);
2425

2526
assertFalse(sut.isFallbackModeOn());
@@ -28,17 +29,17 @@ public void testHealthCheckArcusCluster_whenFallbackModeIsOn_andWhenArcusCluster
2829
@Test
2930
public void testHealthCheckArcusCluster_whenFallbackModeIsOn_andWhenArcusClusterIsAvailable_butFallbackEnabledIsFalse_thenFallbackModeShouldStayOn() throws InterruptedException {
3031
HashMap<String, String> properties = new HashMap<>();
31-
properties.put("hibernate.cache.arcus.host", "localhost:12181");
32-
properties.put("hibernate.cache.arcus.serviceCode", "test");
33-
properties.put("hibernate.cache.arcus.initFallbackMode", "true");
34-
properties.put("hibernate.cache.arcus.fallbackEnabled", "false");
32+
properties.put(HIBERNATE_CACHE_ARCUS_HOST, "localhost:12181");
33+
properties.put(HIBERNATE_CACHE_ARCUS_SERVICE_CODE, "test");
34+
properties.put(HIBERNATE_CACHE_ARCUS_INIT_FALLBACK_MODE, "true");
35+
properties.put(HIBERNATE_CACHE_ARCUS_FALLBACK_ENABLED, "false");
3536

36-
properties.put("hibernate.cache.arcus.healthCheckIntervalInSec", "1");
37+
properties.put(HIBERNATE_CACHE_ARCUS_HEALTH_CHECK_INTERVAL_IN_SEC, "1");
3738
HibernateArcusClientFactory sut = new HibernateArcusClientFactory(new ArcusClientConfig(properties));
3839
assertTrue(sut.isFallbackModeOn());
3940

4041
Thread.sleep(1500);
4142

4243
assertTrue(sut.isFallbackModeOn());
4344
}
44-
}
45+
}

src/test/java/hibernate/ReadWriteAccessDomainDataRegionGroupTest.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package hibernate;
22

3+
import com.devookim.hibernatearcus.config.HibernateArcusProperties;
34
import com.devookim.hibernatearcus.factory.HibernateArcusRegionFactory;
45
import lombok.NoArgsConstructor;
56
import org.hibernate.Session;
@@ -36,8 +37,7 @@ protected void configure(Configuration cfg) {
3637
cfg.setProperty(Environment.SHOW_SQL, "true");
3738
cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "true");
3839
cfg.setProperty(Environment.CACHE_REGION_FACTORY, HibernateArcusRegionFactory.class.getName());
39-
cfg.setProperty("hibernate.cache.arcus.enableCacheEvictOnCachePut", "true");
40-
cfg.setProperty("hibernate.cache.arcus.regionGroupOnCacheEvict", DomainRegionOne.regionName + "," + DomainRegionTwo.regionName);
40+
cfg.setProperty(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_EVICTION_REGION_GROUP_ON_CACHE_UPDATE, DomainRegionOne.regionName + "," + DomainRegionTwo.regionName);
4141
}
4242

4343
@Before
@@ -89,12 +89,8 @@ public void testCacheEvictOnCachePut_whenADomainRegionOneEntityIsDeleted_thenDom
8989
assertEquals(1, regionTwoStat.getMissCount());
9090
}
9191

92-
/**
93-
* When update of regionOneEntity and delete of the regionTwo are executed in a transaction, delete is called after update and the cache item that the update put is evicted.
94-
* As a result, the next get operation of the updated entity will get cacheMiss
95-
*/
9692
@Test
97-
public void testCacheEvictOnCachePut_whenDomainRegionOneEntityIsDeletedAndDomainRegionTwoIsUpdatedInTheSameTransaction_thenDomainRegionTwoShouldBeCacheMiss() {
93+
public void testCacheEvictOnCachePut_whenDomainRegionOneEntityIsDeletedAndDomainRegionTwoIsUpdatedInTheSameTransaction_thenDomainRegionTwoShouldBeCacheHit() {
9894
CacheRegionStatistics regionOneStat = sessionFactory()
9995
.getStatistics().getDomainDataRegionStatistics(DomainRegionOne.regionName);
10096
CacheRegionStatistics regionTwoStat = sessionFactory()
@@ -112,7 +108,6 @@ public void testCacheEvictOnCachePut_whenDomainRegionOneEntityIsDeletedAndDomain
112108
System.out.println("============================");
113109

114110
assertEquals(1, regionOneStat.getPutCount());
115-
assertEquals(0, regionOneStat.getHitCount());
116111
assertEquals(1, regionTwoStat.getPutCount());
117112

118113
s = openSession();
@@ -128,7 +123,6 @@ public void testCacheEvictOnCachePut_whenDomainRegionOneEntityIsDeletedAndDomain
128123
System.out.println("============================");
129124

130125
assertEquals(1, regionTwoStat.getHitCount());
131-
assertEquals(0, regionTwoStat.getMissCount());
132126

133127
s = openSession();
134128
s.beginTransaction();
@@ -137,8 +131,7 @@ public void testCacheEvictOnCachePut_whenDomainRegionOneEntityIsDeletedAndDomain
137131
s.getTransaction().commit();
138132
s.close();
139133
assertNull(domainRegionOneAfterDelete);
140-
assertEquals(1, regionTwoStat.getHitCount());
141-
assertEquals(1, regionTwoStat.getMissCount());
134+
assertEquals(2, regionTwoStat.getHitCount());
142135
}
143136

144137
@Test
@@ -183,13 +176,8 @@ public void testCacheEvictOnCachePut_whenADomainRegionOneEntityIsUpdated_thenDom
183176
assertEquals(1, regionTwoStat.getMissCount());
184177
}
185178

186-
/**
187-
* When updates of regionOne and regionTwo are executed in a transaction, the cache items of both region entities are put.
188-
* However the second update evicts the cache item of the first update.
189-
* As a result, the next get operation of regionOne will get cacheMiss, and regionTwo will get cacheHit
190-
*/
191179
@Test
192-
public void testCacheEvictOnCachePut_whenDomainRegionOneEntityAndDomainRegionOneEntityAreUpdatedInTheSameTransaction_thenDomainRegionOneShouldBeCacheMissAndDomainRegionTwoShouldBeCacheHit() {
180+
public void testCacheEvictOnCachePut_whenDomainRegionOneEntityAndDomainRegionOneEntityAreUpdatedInTheSameTransaction_thenBothShouldBeCacheHit() {
193181
CacheRegionStatistics regionOneStat = sessionFactory()
194182
.getStatistics().getDomainDataRegionStatistics(DomainRegionOne.regionName);
195183
CacheRegionStatistics regionTwoStat = sessionFactory()
@@ -231,8 +219,7 @@ public void testCacheEvictOnCachePut_whenDomainRegionOneEntityAndDomainRegionOne
231219
s.get(DomainRegionTwo.class, id);
232220
s.getTransaction().commit();
233221
s.close();
234-
assertEquals(1, regionOneStat.getHitCount());
235-
assertEquals(1, regionOneStat.getMissCount());
222+
assertEquals(2, regionOneStat.getHitCount());
236223
assertEquals(2, regionTwoStat.getHitCount());
237224
}
238225

src/test/java/hibernate/TransactionAccessDomainDataRegionGroupTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package hibernate;
22

3+
import com.devookim.hibernatearcus.config.HibernateArcusProperties;
34
import com.devookim.hibernatearcus.factory.HibernateArcusRegionFactory;
45
import lombok.NoArgsConstructor;
56
import org.hibernate.Session;
@@ -38,8 +39,7 @@ protected void configure(Configuration cfg) {
3839
cfg.setProperty(Environment.SHOW_SQL, "true");
3940
cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "true");
4041
cfg.setProperty(Environment.CACHE_REGION_FACTORY, HibernateArcusRegionFactory.class.getName());
41-
cfg.setProperty("hibernate.cache.arcus.enableCacheEvictOnCachePut", "true");
42-
cfg.setProperty("hibernate.cache.arcus.regionGroupOnCacheEvict", DomainRegionOne.regionName + "," + DomainRegionTwo.regionName);
42+
cfg.setProperty(HibernateArcusProperties.HIBERNATE_CACHE_ARCUS_EVICTION_REGION_GROUP_ON_CACHE_UPDATE, DomainRegionOne.regionName + "," + DomainRegionTwo.regionName);
4343
}
4444

4545
@Before

0 commit comments

Comments
 (0)