java ehcache + spring — не кешується один метод
привіт всім
проблема з тим що не кешуються деякі методи.. а деякі кешуються.
---------------------------------------------------------------------------------------------------
class MdxQueryExecutor implements Query {
@Override
@Cacheable(CACHE_QUERY)
public CellSet executeStoredQuery(AbstractDashboardService service, String queryName, CommonParameters params, Object... values) {
System.out.println("2");
return null;
}
@Override
@Cacheable(CACHE_QUERY)
public CellSet executeQuery(String query) {
System.out.println("sdasdas");
return null;
}--------------------------------------------------------------------------------------------------- @Autowired
Query query; \\ це інтерфейс
@Test
public void mdxQueryTest() {
query.executeStoredQuery( null, "", new CommonParameters());
query.executeStoredQuery( null, "", new CommonParameters());
query.executeQuery("");
query.executeQuery("");
}---------------------------------------------------------------------------------------------------executeQuery — кешується нормально
executeStoredQuery — не кешується.. !!!! ну чому???
---------------------------------------------------------------------------------------------------
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false" maxBytesLocalHeap="500M" maxBytesLocalDisk="2G"> <diskStore path="java.io.tmpdir"/> <cache name="query" eternal="false" timeToIdleSeconds="0" timeToLiveSeconds="86400" memoryStoreEvictionPolicy="LRU" overflowToDisk="true" diskPersistent="false" statistics="true"/> </ehcache>---------------------------------------------------------------------------------------------------
<dependency> <groupId>com.googlecode.ehcache-spring-annotations</groupId> <artifactId>ehcache-spring-annotations</artifactId> <version>1.2.0</version> </dependency>
7 коментарів
Додати коментар Підписатись на коментаріВідписатись від коментарів