Gemfire中的多个缓存创建

时间:2013-08-06 12:56:45

标签: java spring-data gemfire spring-data-gemfire

我正在尝试在一个JVM中创建一个本地缓存和一个客户端缓存,但是我得到下面所述的错误,我认为由于缓存是单例而发生的,你只能为每个JVM创建一个。

有人知道一个好的工作吗?

错误:

Error creating bean with name 'ccf': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: The singleton cache was created by CacheFactory not ClientCacheFactory.

Cache.xml:

<gfe:cache id="localCache"/> 

<gfe:client-cache id="ccf" pool-name="gfPool" properties-ref="clientCacheProperties" />

<gfe:pool id="gfPool" subscription-enabled="true" load-conditioning-interval="6000" socket-buffer-size="65535" thread-local-connections="true" read-timeout="6000"
    idle-timeout="6000" retry-attempts="-1" ping-interval="5000" max-connections="-1">
    <gfe:locator host="127.0.0.1" port="10083" />
</gfe:pool>

<gfe:local-region id="localRegion"  cache-ref="localCache"/> 

<gfe:client-region id="region" cache-ref="ccf" pool-name="gfPool" name="regionName" shortcut="CACHING_PROXY"/>

1 个答案:

答案 0 :(得分:3)

您无法在同一JVM中定义多个缓存。缓存是单身人士。请参阅 API docs