HHH-11516 : Level two cache may not be enabled when using @Cacheable without/instead of @Cache
This commit is contained in:
parent
640680fcbc
commit
12a1b3c225
|
@ -1156,16 +1156,11 @@ public final class AnnotationBinder {
|
||||||
return new LocalCacheAnnotationImpl( region, determineCacheConcurrencyStrategy( context ) );
|
return new LocalCacheAnnotationImpl( region, determineCacheConcurrencyStrategy( context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CacheConcurrencyStrategy DEFAULT_CACHE_CONCURRENCY_STRATEGY;
|
|
||||||
|
|
||||||
private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(MetadataBuildingContext context) {
|
private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(MetadataBuildingContext context) {
|
||||||
if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
|
return CacheConcurrencyStrategy.fromAccessType(
|
||||||
DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType(
|
|
||||||
context.getBuildingOptions().getImplicitCacheAccessType()
|
context.getBuildingOptions().getImplicitCacheAccessType()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings({ "ClassExplicitlyAnnotation" })
|
@SuppressWarnings({ "ClassExplicitlyAnnotation" })
|
||||||
private static class LocalCacheAnnotationImpl implements Cache {
|
private static class LocalCacheAnnotationImpl implements Cache {
|
||||||
|
|
Loading…
Reference in New Issue