-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
Rosendo Alvarez opened SPR-13641 and commented
When using jcache annotations to cache the results of a method call using ehcache as the caching implementation, the caching of null values is not allowed even though the JCacheCacheManager explicitly has an option to "allowNullValues".
App context:
<cache:annotation-driven />
<bean id="cacheManager" class="org.springframework.cache.jcache.JCacheCacheManager">
<property name="allowNullValues" value="true" />
</bean>
dependencies:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>jcache</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.1</version>
</dependency>
@CacheResult(cacheName = "reserveTypes")
public String findReserveTypeByName(String reserveTypeName) {
if (reserveTypeName == "test") {
logger.info("This is not being retrieved from cache.");
return null;
}
return "this will be cached";
}
Affects: 4.2.2
Attachments:
- ehcache.xml (450 bytes)
1 votes, 3 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement