-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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: bugA general bugA general bug
Milestone
Description
Kazuki Shimizu opened SPR-14314 and commented
I've tried a new feature of cacheing supported at Spring 4.3.
I've used the storeByValue property of ConcurrentMapCacheManager as follow:
@EnableCaching
@Configuration
public class CacheConfig {
@Bean
CacheManager cacheManager() {
ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager("configs");
cacheManager.setStoreByValue(true);
return cacheManager;
}
}
However, it does not worked serialization and deserialization a cache value :(
Is my configuration wrong ?
I've tried as follow, it work fine. I want to know best configuration for this case.
@EnableCaching
@Configuration
public class CacheConfig implements BeanClassLoaderAware { // Add
ClassLoader classLoader;
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
@Bean
CacheManager cacheManager() {
ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager("configs");
cacheManager.setBeanClassLoader(classLoader); // Add
cacheManager.setStoreByValue(true);
return cacheManager;
}
}
Affects: 4.3 RC2
Issue Links:
- Support store-by-value in ConcurrentMapCacheManager [SPR-13758] #18331 Support store-by-value in ConcurrentMapCacheManager
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug