简体   繁体   English

Gemfire中的多个缓存创建

[英]Multiple cache creations in Gemfire

I'm trying to create a local-cache and a client-cache inside one JVM, however i get the error stated below which i think is occuring due to cache being singleton and you can only create one per JVM. 我正在尝试在一个JVM中创建一个本地缓存和一个客户端缓存,但是我得到下面所述的错误,我认为由于缓存是单例而发生的,你只能为每个JVM创建一个。

Does anybody know a good work around? 有人知道一个好的工作吗?

Error: 错误:

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: 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"/>

You can't define more than one cache in the same JVM. 您无法在同一JVM中定义多个缓存。 A cache is a singleton. 缓存是单身人士。 See the API docs . 请参阅API文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM