Skip to content

Commit

Permalink
HHH-12248 Clustered 2nd level cache sometimes throws NullPointerExcep…
Browse files Browse the repository at this point in the history
…tion - rearrange constructor to avoid race condition
  • Loading branch information
Tom Dearman authored and vladmihalcea committed Jan 30, 2018
1 parent ec5c9ce commit 977cafc
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -156,6 +156,10 @@ public PutFromLoadValidator(AdvancedCache cache, InfinispanRegionFactory regionF
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).
Expand All @@ -166,9 +170,6 @@ public PutFromLoadValidator(AdvancedCache cache, InfinispanRegionFactory regionF
}
addToCache(cache, this);
}

this.cache = cache;
this.pendingPuts = cacheManager.getCache(pendingPutsName);
}

/**
Expand Down

0 comments on commit 977cafc

Please sign in to comment.