1

使用相同的配置,只有 defaultCache,我得到不一致的数据(案例 A)。但是如果我添加一个额外的缓存条目将不会得到那些不一致的错误(案例B)。

你知道为什么吗?

我不想设置设置 aumaticamente defaultCache 的 130 个缓存

提前致谢

PS我一直猜想什么没有指定,将EHCache作为模板使用defaultCache设置。

案例一:

<defaultCache  
     maxElementsInMemory="10000"  
     eternal="false"  
     timeToIdleSeconds="0"  
     overflowToDisk="false"  

>  
    <cacheEventListenerFactory  
         class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"  

     />  
     <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" />  
 </defaultCache>

`

案例B:

<defaultCache  
     maxElementsInMemory="10000"  
     eternal="false"  
     timeToIdleSeconds="0"  
     overflowToDisk="false"  

 >  
     <cacheEventListenerFactory  
         class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"  

     />  
     <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" />  
 </defaultCache>  

 <cache  
     name="com.liferay.portal.model.impl.LayoutImpl"  
     maxElementsInMemory="10000"  
     eternal="false"  
     timeToIdleSeconds="0"  
     overflowToDisk="false"  
 >  
     <cacheEventListenerFactory  
         class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"  
     />  
     <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" />  
 </cache>  
4

2 回答 2

0

由于您还没有说如何使用缓存,因此很难猜测您真正在做什么以及您的意思是什么不一致的错误。

也许您没有使用缓存实体来缓存查询结果,这使得从缓存中读取实体并从数据库中查询?有很多可能的情况。

于 2011-02-28T14:51:51.560 回答
0

我们尝试在集群环境上运行 Liferay 并得到同样的错误:默认配置不起作用。我做了一些更改,也许我的配置会对你有所帮助。

休眠-clustered.xml

liferay-multi-vm-clustered.xml

于 2011-03-09T10:33:17.860 回答