jbosscache1.4 invalidation模式下put会导致发送invalidation的问题
????我们在项目中使用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
??
?? <!---->
?? <!---->
?? <!---->
?? <!---->
?? <!---->