HHH-12248 Clustered 2nd level cache sometimes throws NullPointerException - rearrange constructor to avoid race condition

This commit is contained in:
Tom Dearman 2018-01-24 10:08:05 +00:00 committed by Vlad Mihalcea
parent ec5c9ce7e6
commit 977cafca3c
1 changed files with 4 additions and 3 deletions

View File

@ -156,6 +156,10 @@ public class PutFromLoadValidator {
else {
throw log.pendingPutsMustHaveMaxIdle();
}
this.cache = cache;
this.pendingPuts = cacheManager.getCache(pendingPutsName);
CacheMode cacheMode = cache.getCacheConfiguration().clustering().cacheMode();
// Since we need to intercept both invalidations of entries that are in the cache and those
// that are not, we need to use custom interceptor, not listeners (which fire only for present entries).
@ -166,9 +170,6 @@ public class PutFromLoadValidator {
}
addToCache(cache, this);
}
this.cache = cache;
this.pendingPuts = cacheManager.getCache(pendingPutsName);
}
/**