Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4348

Configuration parser loses <persistence/> element configuration

    XMLWordPrintable

Details

    • Hide

      1) Configure named cache as following
      <namedCache name="string-cache">
      <clustering mode="distribution">
      <sync />
      <stateTransfer fetchInMemoryState="true" />
      <hash numOwners="2" />
      </clustering>
      <persistence>
      <store class="com.example.CustomCacheStore"
      fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
      </store>
      </persistence>
      </namedCache>

      2) Start cluster using new DefaultCacheManager("infinispan.xml")
      3) Put any object in cache

      Expected:
      CustomCacheStore.write() is triggered

      Actual:
      CustomCacheStore.write() is not triggered

      Show
      1) Configure named cache as following <namedCache name="string-cache"> <clustering mode="distribution"> <sync /> <stateTransfer fetchInMemoryState="true" /> <hash numOwners="2" /> </clustering> <persistence> <store class="com.example.CustomCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false"> </store> </persistence> </namedCache> 2) Start cluster using new DefaultCacheManager("infinispan.xml") 3) Put any object in cache Expected: CustomCacheStore.write() is triggered Actual: CustomCacheStore.write() is not triggered

    Description

      I have a following configuration of named cache:
      <namedCache name="string-cache">
      <clustering mode="distribution">
      <sync />
      <stateTransfer fetchInMemoryState="true" />
      <hash numOwners="2" />
      </clustering>
      <persistence>
      <store class="org.sproot_grid.infinispan.cachestore.StringCacheStore"
      fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
      </store>
      </persistence>
      </namedCache>

      where StringCacheStore is my own implementation of CacheStore (implements AdvancedLoadWriteStore).

      I start cluster using constructor DefaultCacheManager(String configurationFile), but cache modifications don't trigger write-through because there is no stores in Configuration object.

      I investigated it in debug mode and found that configuration parser (Parser60) reads <store /> element but doesn't apply it to ConfigurationBuilder object if store is not an instance of SingleFileStore or ClusterLoader, so it means that I can't configure my custom CacheStore

      This is a copy of my stack during configuration reading:
      Thread [main] (Suspended (breakpoint at line 640 in Parser60))
      Parser60.parseStore(XMLExtendedStreamReader, ConfigurationBuilderHolder) line: 640
      Parser60.parsePersistence(XMLExtendedStreamReader, ConfigurationBuilderHolder) line: 555
      Parser60.parseCache(XMLExtendedStreamReader, ConfigurationBuilderHolder) line: 150
      Parser60.parseNamedCache(XMLExtendedStreamReader, ConfigurationBuilderHolder) line: 109
      Parser60.readElement(XMLExtendedStreamReader, ConfigurationBuilderHolder) line: 76
      ParserRegistry.parseElement(XMLExtendedStreamReader, ConfigurationBuilderHolder) line: 141
      ParserRegistry.parse(XMLExtendedStreamReader, ConfigurationBuilderHolder) line: 123
      ParserRegistry.parse(InputStream, ConfigurationBuilderHolder) line: 110
      ParserRegistry.parse(InputStream) line: 97
      DefaultCacheManager.<init>(InputStream, boolean) line: 253
      DefaultCacheManager.<init>(String, boolean) line: 226
      DefaultCacheManager.<init>(String) line: 213
      ClusterFacade.init() line: 48
      ClusterFacade.getFacade() line: 41
      ClusterFacadeTest.initCluster() line: 21
      NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
      NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
      DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
      Method.invoke(Object, Object...) line: 601
      FrameworkMethod$1.runReflectiveCall() line: 44
      FrameworkMethod$1(ReflectiveCallable).run() line: 15
      FrameworkMethod.invokeExplosively(Object, Object...) line: 41
      RunBefores.evaluate() line: 27
      BlockJUnit4ClassRunner(ParentRunner<T>).run(RunNotifier) line: 236
      JUnit4TestMethodReference(JUnit4TestReference).run(TestExecution) line: 50
      TestExecution.run(ITestReference[]) line: 38
      RemoteTestRunner.runTests(String[], String, TestExecution) line: 467
      RemoteTestRunner.runTests(TestExecution) line: 683
      RemoteTestRunner.run() line: 390
      RemoteTestRunner.main(String[]) line: 197

      Attachments

        Activity

          People

            Unassigned Unassigned
            aolenev_jira Alexey Olenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: