我工作的緩存實現(exstremescale)Maven的多模塊項目,在那裏我已經添加下面的Maven依賴於緩存攔截器調用將被忽略
@Override
@Cacheable(value = "productDetails", key = "#productId + #orgId")
public Product productRead(final String productId, final String productKey, final String orgId, final CRApplicationEnum sourceSystem) throws IntegrationException {
的cache
<dependency>
<groupId>com.ibm.extremescale</groupId>
<artifactId>ogclient</artifactId>
<version>8.6.0.20150901-215917</version>
</dependency>
添加緩存註解manager.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
<cache:annotation-driven />
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager" primary="true">
<property name="caches">
<set>
<bean class="com.ibm.websphere.objectgrid.spring.ObjectGridCache"
p:name="eventDetails" p:map-name="${iev.eventDetails.mapName}"
p:object-grid-client-ref="wxsGridClient" />
<bean class="com.ibm.websphere.objectgrid.spring.ObjectGridCache"
p:name="eventValidationDetails" p:map-name="${iev.eventValidationDetails.mapName}"
p:object-grid-client-ref="wxsGridClient" />
<bean class="com.ibm.websphere.objectgrid.spring.ObjectGridCache"
p:name="productDetails" p:map-name="${ipr.productDetails.mapName}"
p:object-grid-client-ref="wxsGridClient" />
</set>
</property>
</bean>
<bean id="wxsCSDomain"
class="com.ibm.websphere.objectgrid.spring.ObjectGridCatalogServiceDomainBean"
p:catalog-service-endpoints="${xscale.catalogServiceEndpoint}" />
<bean id="wxsGridClient"
class="com.ibm.websphere.objectgrid.spring.ObjectGridClientBean"
p:catalog-service-domain-ref="wxsCSDomain" p:objectGridName="${wxs.objectGridName}" />
緩存僅適用於項目的一個maven模塊,我可以看到緩存攔截器調用,對於其餘的maven模塊,它忽略@cacheable註釋(它不會去攔截器)。
我們沒有PostConstructor或Self invokation
我們正在使用Atomikos公司的事務管理器和將來到高速緩存方法前執行CXF -interceptors。
請幫我在這
在模塊上工作,而不是其他人有點奇怪我會說。 Spring應用程序上下文不關心你的類從哪裏加載。你正在使用父/子上下文嗎? –
在調試時我們知道,由JdkDynamicAopProxy類爲具有可緩存註釋的bean準備的攔截器列表沒有將緩存攔截器添加到列表中。 –
你可以分享一個樣本,這會容易得多。你可以顯示該bean的bean配置嗎?你有沒有機會展示一個界面? –