Skip to content

Commit 12a1b3c

Browse files
Gail Badnergbadner
Gail Badner
authored andcommitted
HHH-11516 : Level two cache may not be enabled when using @Cacheable without/instead of @Cache
1 parent 640680f commit 12a1b3c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,15 +1156,10 @@ private static Cache buildCacheMock(String region, MetadataBuildingContext conte
11561156
return new LocalCacheAnnotationImpl( region, determineCacheConcurrencyStrategy( context ) );
11571157
}
11581158

1159-
private static CacheConcurrencyStrategy DEFAULT_CACHE_CONCURRENCY_STRATEGY;
1160-
11611159
private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(MetadataBuildingContext context) {
1162-
if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
1163-
DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType(
1164-
context.getBuildingOptions().getImplicitCacheAccessType()
1165-
);
1166-
}
1167-
return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
1160+
return CacheConcurrencyStrategy.fromAccessType(
1161+
context.getBuildingOptions().getImplicitCacheAccessType()
1162+
);
11681163
}
11691164

11701165
@SuppressWarnings({ "ClassExplicitlyAnnotation" })

0 commit comments

Comments
 (0)