3 Replies Latest reply on Dec 6, 2017 6:03 AM by Sebastian Łaskawiec

    Persistence singlefilestore with Spring JCache fails to hot reload

    Preben Asmussen Newbie

      Hi

       

      I'm using Spring Boot 1.5.8.RELEASE with Infinispan 9.1.3.Final with JCache.

      In spring 4.3.x they introduced a Cachable(sync=true) option see Integration
      This seem not supported in Infinispan when using singleFilestore as persistence option. (Cache entries are not written to the cache store file resulting in shortcutting the cache)

       

      My boot cache setup ->

       

      @Bean(destroyMethod = "stop")

          public CacheManager cacheManager() {

              ConfigurationBuilder config = new ConfigurationBuilder();

              //@formatter:off

              config.expiration().lifespan(2, TimeUnit.DAYS)

              .transaction()

                  .transactionMode(TransactionMode.TRANSACTIONAL)

              .persistence()

                  .addSingleFileStore()

                      .shared(false)

                      .fetchPersistentState(true)

                      .ignoreModifications(false)

                      .purgeOnStartup(false)

                      .location(props.persistentFileLocation);

             

              GlobalConfigurationBuilder globalConfig = new GlobalConfigurationBuilder();

                  globalConfig.globalJmxStatistics()

                  .allowDuplicateDomains(true);

              //formatter:on

              return new SpringEmbeddedCacheManager(new DefaultCacheManager(globalConfig.build(), config.build(), true));

          }

       

      jcache method ->

       

      @Cacheable(sync = true)

          public List<Program> getFromCache(String channel, LocalDate date) {

              return someMethod(channel, broadcastDate);

          }

       

      Second observation

      It seems that 9.1.3.Final has some broken transient dependency on  org.infinispan:infinispan-spring4-common:jar:8.2.8.Final

       

      [INFO] +- org.infinispan:infinispan-spring4-embedded:jar:9.1.3.Final:compile

      [INFO] |  +- org.infinispan:infinispan-core:jar:9.1.3.Final:compile

      [INFO] |  |  +- org.infinispan:infinispan-commons:jar:9.1.3.Final:compile

      [INFO] |  |  +- org.jgroups:jgroups:jar:4.0.7.Final:compile

      [INFO] |  |  +- com.github.ben-manes.caffeine:caffeine:jar:2.3.5:compile

      [INFO] |  |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile

      [INFO] |  |  \- org.jboss.marshalling:jboss-marshalling-osgi:jar:2.0.0.Beta3:compile

      [INFO] |  \- org.infinispan:infinispan-spring4-common:jar:8.2.8.Final:compile

      [INFO] |     \- commons-pool:commons-pool:jar:1.6:runtime