我们在项目中使用jbosscache来做分布式缓存部分数据库数据。打算用INVALIDATION_SYNC来将remove的数据失效掉,
但令人失望的是,我们在put数据的时候,发现它也会广播invalidation消息,导致数据失效。这样的结果是,只有1台服务器有
缓存数据,其他服务器从数据库取到相同数据put到缓存时,就会导致其他服务器缓存失效,但这个操作实际上没有修改数据。
实在是不合理。可能是我们的使用方式有问题,或者有其他配置方法,请有这方面的朋友能帮助下,谢谢!
配置文件如下(就是标准的那个invalidationSync-service.xml文件):
<!---->
<!---->
<!---->
<!---->
<!---->
<!---->
<server></server>
<classpath archives="jboss-cache.jar, jgroups.jar" codebase="./lib"></classpath>
<!---->
<!---->
<!---->
<mbean code="org.jboss.cache.CacheImpl"></mbean> name="jboss.cache:service=TreeCache">
<depends></depends>jboss:service=Naming
<depends></depends>jboss:service=TransactionManager
<!---->
<attribute name="TransactionManagerLookupClass"></attribute>org.jboss.cache.DummyTransactionManagerLookup
<!---->
<attribute name="IsolationLevel"></attribute>REPEATABLE_READ
<!---->
<attribute name="CacheMode"></attribute>INVALIDATION_SYNC
<!---->
<attribute name="UseReplQueue"></attribute>false
<!---->
<attribute name="ReplQueueInterval"></attribute>0
<!---->
<attribute name="ReplQueueMaxElements"></attribute>0
<!---->
<attribute name="ClusterName"></attribute>JBossCache-Cluster
<!---->
<!---->
<!---->
<attribute name="ClusterConfig"></attribute>
<config></config>
<!---->
<!---->
<udp mcast_addr="228.1.2.3" mcast_port="48866"></udp> ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
loopback="false"/>
<ping num_initial_members="3" timeout="2000"></ping>
up_thread="false" down_thread="false"/>
<merge2 max_interval="20000" min_interval="10000"></merge2>
<!---->
<fd_sock></fd_sock>
<verify_suspect timeout="1500"></verify_suspect> up_thread="false" down_thread="false"/>
<pbcast.nakack retransmit_timeout="600,1200,2400,4800" gc_lag="50"></pbcast.nakack>
max_xmit_size="8192" up_thread="false" down_thread="false"/>
<unicast timeout="600,1200,2400" down_thread="false"></unicast>
<pbcast.stable desired_avg_gossip="20000"></pbcast.stable>
up_thread="false" down_thread="false"/>
<frag frag_size="8192"></frag> down_thread="false" up_thread="false"/>
<pbcast.gms join_retry_timeout="2000" join_timeout="5000"></pbcast.gms>
shun="true" print_local_addr="true"/>
<pbcast.state_transfer down_thread="true" up_thread="true"></pbcast.state_transfer>
<!---->
<attribute name="FetchInMemoryState"></attribute>true
<!---->
<attribute name="InitialStateRetrievalTimeout"></attribute>15000
<!---->
<attribute name="SyncReplTimeout"></attribute>15000
<!---->
<attribute name="LockAcquisitionTimeout"></attribute>10000
<!---->
<attribute name="EvictionPolicyClass"></attribute>
<!---->
<attribute name="UseRegionBasedMarshalling"></attribute>false
<!---->
<!---->
<!---->
<!---->
<!---->
分享到:
相关推荐
JbossCache中文文档由邱奎宁翻译,本人制作。
jbosscache 1.2.4 源代码和sample
jbosscache-core-3.2.7.GA.jar
JbossCache中文文档,很好的学习文档!!
jbosscache3.2.5 jar 包 jbosscache-core-sources.jar jboss-logging-spi.jar jboss-transaction-api.jar
jbosscache manual jbosscache manual jbosscache manual jbosscache manual jbosscache manual
jbosscache-1.4.1.jar
jbosscache-userguide_zh_CN jbosscache-userguide_zh_CN jbosscache-userguide_zh_CN
jbosscache-core-3.1.0.jar
JBoss Cache用户向导笔记,支持集群、事务的缓存技术
JBoss Cache 缓存 讲解说明
其中jbosscache-core-sources.jar为源代码jar包;jbosscache-core.jar含jbosscache的核心代码; lib中含有jbosscache-core.jar中所用到得class文件; etc中含有一些配置文件的样例
红帽公司jboss的内部资料,版本 2.2.0 Poblano版,需要的可以下载!
基准-jbosscache
非常好的jbosscache教程,在其他地方下的,上传上来有时间就看看。
目前大部分开源的分布式缓存的底层都是基于JGroups,包括鼎鼎大名的JBossCache、OSCache等等。 ayufox,20060717122217.gif 上图为JavaGroups的概念架构图。可以看出,JavaGroups从概念上自下而上分为三个部分,协议...
最简单的无非就是static HashMap,这个显然是基于内存缓存,一个map就可以搞定引用对象的缓存,最简单也最不实用,首要的问题就是保存对象的有效性以及周期无法控制,这样很容易就导致内存急剧上升,周期无法控制...
NULL 博文链接:https://j2ee2009.iteye.com/blog/773519
jboss-cache.jar jboss-cache.jar