hibernate+ehcache 集群配置
照着网上的方法,配了一下ehcache的集群。但发现,不起效果。改了一边,另外一台服务器上的缓存没改。
我贴一下配置。帮我看下什么问题,还是说因为我这个cache name,直接对应了一个实体,是不行的,需要实体里,再去写缓存处理的代码。rmiUrls里要指定缓存名称,那么defaultCache的怎么办。
我贴一下配置。帮我看下什么问题,还是说因为我这个cache name,直接对应了一个实体,是不行的,需要实体里,再去写缓存处理的代码。rmiUrls里要指定缓存名称,那么defaultCache的怎么办。
<?xml version="1.0"?>
<ehcache updateCheck="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../config/ehcache.xsd">
<diskStore path="java.io.tmpdir" />
<cache name="com.wxbusiness.entities.Distributor" maxElementsInMemory="3000" eternal="false"
timeToIdleSeconds="3600" timeToLiveSeconds="7200" overflowToDisk="true"
maxElementsOnDisk="10000" diskPersistent="false"
diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true,
replicatePuts=true, replicateUpdates=true,replicateUpdatesViaCopy=false,
replicateRemovals=true "/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
</cache>
<defaultCache name="dCache" maxElementsInMemory="1000" eternal="false"
timeToIdleSeconds="3600" timeToLiveSeconds="3600" overflowToDisk="false"
maxElementsOnDisk="10000" diskPersistent="false"
diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" >
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true,
replicatePuts=true, replicateUpdates=true,replicateUpdatesViaCopy=false,
replicateRemovals=true "/>
<bootstrapCacheLoaderFactory
class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
</defaultCache>
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="
socketTimeoutMillis=2000,
peerDiscovery=manual,
rmiUrls=//192.168.1.104:40002/com.wxbusiness.entities.Distributor|//192.168.1.104:40002/dCache"
/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=192.168.1.104,port=40001,socketTimeoutMillis=120000"/>
</ehcache>
...全文
相关推荐
Spring+EHcache缓存实例详解
主要为大家详细介绍了Spring+EHcache缓存实例,EhCache是一个纯Java的进程内缓存框架,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
Ehcache缓存框架
ehcache的eclipse project demo 博文链接:https://kt8668.iteye.com/blog/175843
Struts+spring+hibernate面试资料
Struts+spring+hibernate面试资料 面试很有用
hibernate-orm-master.zip
hibernate源码
struts+spring+hibernate笔试面试常见问题
Hibernate是一个开放源代码的对象关系映射框架,它对JDBC进行了非常轻量级的对象封装,使得Java程序员可以随心所欲的使用对象编程思维来操纵数据库。


