Questions tagged «ehcache»


8
Spring Cache @Cacheable-从同一个bean的另一个方法调用时不起作用
从同一bean的另一个方法调用缓存的方法时,Spring缓存不起作用。 这是一个清楚地说明我的问题的示例。 组态: <cache:annotation-driven cache-manager="myCacheManager" /> <bean id="myCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"> <property name="cacheManager" ref="myCache" /> </bean> <!-- Ehcache library setup --> <bean id="myCache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:shared="true"> <property name="configLocation" value="classpath:ehcache.xml"></property> </bean> <cache name="employeeData" maxElementsInMemory="100"/> 缓存的服务: @Named("aService") public class AService { @Cacheable("employeeData") public List<EmployeeData> getEmployeeData(Date date){ ..println("Cache is not being used"); ... } public List<EmployeeEnrichedData> …
107 java  spring  caching  ehcache 

3
如何在ehcache中区分生存时间和空闲时间
关于ehache的文档说: timeToIdleSeconds: Sets the time to idle for an element before it expires. i.e. The maximum amount of time between accesses before an element expires timeToLiveSeconds: Sets the time to live for an element before it expires. i.e. The maximum time between creation time and when an element expires. 我了解timeToIdleSeconds …
103 java  ehcache 

6
多个方法参数上的@Cacheable键
从spring文档中: @Cacheable(value="bookCache", key="isbn") public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed) 如何指定@Cachable使用isbn和checkWarehouse作为密钥?
77 java  spring  ehcache 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.