Skip to content
Permalink
Browse files
IGNITE-14264 Fixes cache creation by IgniteClientSpringCacheManager w…
…ith invalid name. (#48)
  • Loading branch information
ololo3000 committed Mar 2, 2021
1 parent f99e571 commit 1844edcea035b6d3c0e5a55836abb39a0ae7a378
Showing 2 changed files with 12 additions and 4 deletions.
@@ -3,6 +3,11 @@ Apache Ignite Spring Cache Module

Apache Ignite Spring Cache extension provides an integration with Spring Cache framework.

There are two implementations of Apache Ignite Spring Cache Manager - org.apache.ignite.cache.spring.SpringCacheManager and
org.apache.ignite.cache.spring.IgniteClientSpringCacheManager, that provide ability to use the Ignite thick or thin client to
connect to the Ignite cluster and manage Ignite caches, respectively. Note, that org.apache.ignite.cache.spring.IgniteClientSpringCacheManager
can be used only with Ignite since 2.11.0 version.

Importing Spring Cache extension In Maven Project
----------------------------------------

@@ -36,6 +36,8 @@
* set before manager use (see {@link #setClientInstance(IgniteClient),
* {@link #setClientConfiguration(ClientConfiguration)}}).
*
* Note that current manager implementation can be used only with Ignite since 2.11.0 version.
* For Ignite versions earlier than 2.11.0 use an {@link SpringCacheManager}.
*
* Note that Spring Cache synchronous mode ({@link Cacheable#sync}) is not supported by the current manager
* implementation. Instead, use an {@link SpringCacheManager} that uses an Ignite thick client to connect to Ignite cluster.
@@ -148,8 +150,7 @@ public IgniteClientSpringCacheManager setClientConfiguration(ClientConfiguration

/** Gets dynamic Ignite cache configuration template. */
public ClientCacheConfiguration getDynamicCacheConfiguration() {
// To avoid copying the dynamic cache configuration each time as we only change its name.
return dynamicCacheCfg == null ? null : dynamicCacheCfg.setName(null);
return dynamicCacheCfg;
}

/**
@@ -164,8 +165,10 @@ public IgniteClientSpringCacheManager setDynamicCacheConfiguration(ClientCacheCo
}

/** {@inheritDoc} */
@Override protected synchronized SpringCache createCache(String name) {
ClientCacheConfiguration ccfg = dynamicCacheCfg == null ? new ClientCacheConfiguration() : dynamicCacheCfg;
@Override protected SpringCache createCache(String name) {
ClientCacheConfiguration ccfg = dynamicCacheCfg == null
? new ClientCacheConfiguration()
: new ClientCacheConfiguration(dynamicCacheCfg);

ClientCache<Object, Object> cache = cli.getOrCreateCache(ccfg.setName(name));

0 comments on commit 1844edc

Please sign in to comment.