2013-05-29 22 views
1

我使用Infinispan作为二级缓存,我有两个应用程序节点。两个应用程序中的L2缓存被复制。这两个应用程序不相同。Infinispan:响应包含多个不等于的元素

我的一个应用程序使用Web服务填充数据库,而其他应用程序为数据库运行GUI。

这两个应用程序都做了广泛的读取和写入数据库。运行应用程序后,我看到以下错误。我不知道是哪个造成这个错误。

我不知道为什么 - 我的缓存实例不正确复制每次更改其他

  • L2高速缓存有两个寄托

  • L2的反应是不相等的

ERROR org.infinispan.interceptors.InvocationContextInterceptor - ISPN000136: Execution error

2013-05-29 06:32:32 ERROR - Exception while processing event, reason: org.infinispan.loaders.CacheLoaderException: Responses contains more than 1 element and these elements are not equal, so can't decide which one to use:

[SuccessfulResponse{responseValue=TransientCacheValue{maxIdle=100000, lastUsed=1369809152081} TransientCacheValue {value=MarshalledValue{instance=, serialized=ByteArray{size=1911, array=0x0301fe0409000000..}, cachedHashCode=1816114786}@57991642}} ,

SuccessfulResponse{responseValue=TransientCacheValue{maxIdle=100000, lastUsed=1369809152116} TransientCacheValue {value=MarshalledValue{instance=, serialized=ByteArray{size=1911, array=0x0301fe0409000000..}, cachedHashCode=1816114786}@6cdaa731}} ]

我Infinispan的配置是

<globalJmxStatistics enabled="true" jmxDomain="org.infinispan" allowDuplicateDomains="true"/> 

    <transport 

      transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" 

      clusterName="infinispan-hibernate-cluster" 

      distributedSyncTimeout="50000" 

      strictPeerToPeer="false"> 

     <properties> 

      <property name="configurationFile" value="jgroups.xml"/> 

     </properties> 

    </transport> 

</global> 



<default> 

</default> 



<namedCache name="my-cache-entity"> 

    <clustering mode="replication"> 

     <stateRetrieval fetchInMemoryState="false" timeout="60000"/> 

     <sync replTimeout="20000"/> 

    </clustering> 

    <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" 

      lockAcquisitionTimeout="15000" useLockStriping="false"/> 

    <eviction maxEntries="10000" strategy="LRU"/> 

    <expiration maxIdle="100000" wakeUpInterval="5000"/> 

    <lazyDeserialization enabled="true"/> 

    <!--<transaction useSynchronization="true" 

       transactionMode="TRANSACTIONAL" autoCommit="false" 

       lockingMode="OPTIMISTIC"/>--> 

    <loaders passivation="false" shared="false" preload="false"> 

     <loader class="org.infinispan.loaders.cluster.ClusterCacheLoader" 

       fetchPersistentState="false" 

       ignoreModifications="false" purgeOnStartup="false"> 

      <properties> 

       <property name="remoteCallTimeout" value="20000"/> 

      </properties> 

     </loader> 

    </loaders> 

</namedCache> 

回答

1

复制实体缓存应当与状态检索进行配置,如default Infinispan configuration file已经表明,你已经这样做了。 ClusterCacheLoader只能用于特殊情况(用于查询缓存)。为什么不使用默认的Infinsipan配置?事实上,如果你不配置一个配置文件,它将使用默认配置文件。

+0

感谢Galder。我将从实体缓存中删除ClusterCacheLoader,并执行另一个测试周期。似乎我错误地配置了实体缓存。我不能使用默认配置,因为我正在考虑将maxEntries增加到100,000,而不是使用跨国的。此外,我认为lazyDeserialization已被弃用,它应该是storeAsBinary。我也想使用分布作为集群模式而不是复制。我认为它会提高性能,因为我的群集包含6个节点。 – era

相关问题