Stephen Darlington created IGNITE-15960:
-------------------------------------------
Summary: Ignite#getOrCreateNearCache appears to be broken?
Key: IGNITE-15960
URL: https://issues.apache.org/jira/browse/IGNITE-15960
Project: Ignite
Issue Type: Bug
Affects Versions: 2.10
Reporter: Stephen Darlington
I have my Ignite server running a connect a thick-client running some code.
If I don't create any caches in advance and run this code:
{{client.getOrCreateNearCache(CACHE_NAME, new NearCacheConfiguration<Integer,
Integer>()}}
{{.setNearEvictionPolicyFactory(new LruEvictionPolicyFactory<>()));}}
The error I get is:
{{Failed to start client cache (a cache with the given name is not started)}}
Okay, so I create my cache in advance:
{{client.getOrCreateCache(CACHE_NAME);}}
{{client.getOrCreateNearCache(CACHE_NAME, new NearCacheConfiguration<Integer,
Integer>()}}
{{.setNearEvictionPolicyFactory(new LruEvictionPolicyFactory<>()));}}
This time I get the following error:
{{Failed to start near cache (a cache with the same name without near cache is
already started)}}
Okay, so I'll create a cache with a near cache:
{{client.getOrCreateCache(new CacheConfiguration<>()}}
{{.setName(CACHE_NAME)}}
{{.setNearConfiguration(new NearCacheConfiguration()}}
{{.setNearEvictionPolicyFactory(new LruEvictionPolicyFactory<>())));}}
{{client.getOrCreateNearCache(CACHE_NAME, new NearCacheConfiguration<Integer,
Integer>()}}
{{.setNearEvictionPolicyFactory(new LruEvictionPolicyFactory<>()));}}
Still the same error:
{{Failed to start near cache (a cache with the same name without near cache is
already started)}}
So however the cache is created or configured, it appears not to work.
One possibility is that it's only supposed to work on a server where the near
cache already exists. If so, this is not mentioned anywhere in the
documentation.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)