ehcache rmi缓存同步求教
有A、B 2台机,缓存用ehcache,rmi方式,发现缓存不同步。
比如:在A机修改了某个用户,同时更新缓存。但下次访问时,有时候返回更新前结果,有时返回更新后结果,其实就是A机修改缓存后,并没有更新到B机子。
据说是因为ehcache rmi方式的缓存同步不太靠谱,但也不至于这个明显吧。
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual, socketTimeoutMillis=2000, rmiUrls=//ehcache.host.other:40005/activeSessionsCache|//ehcache.host.other:40005/userCache|//ehcache.host.other:40005/sysCache|//ehcache.host.other:40005/actCache" />
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=127.0.0.1, port=40005, socketTimeoutMillis=2000"/>