In my blog, i would discuss the problem i face in daily routine. Following are some of them: mysql error, mysql replication, mysql database corrupted repair, innodb tablespace corruption, mysql storage engines, mysql optimization and tuning, reinstall mysql linux server, linux command for dummies, linux administration tips, mysql administration tips, Linux server benchmarking
Wednesday, December 12, 2018
Spring: Clean up CacheManager Java code
If you had use @Cacheable for your java method, and would like clear the cache on run time.
AND If you are able to execute a groovy script, following solution is for you
Groovy Script
import org.springframework.cache.CacheManager;
cacheManager = spring.getBean("cacheManager");
for(String name:cacheManager.getCacheNames()){
cacheManager.getCache(name).clear();
}
Subscribe to:
Posts (Atom)