infinispanmodeshape

Data is not persisted in ModeShape 3.8


Recently I started working on a project using ModeShape 3.8 and Infinispan 5.3. Original developer already left without any documentation. Application is working fine unless it is not restarted. All data was lost as soon as it is shutdown. May be some transient repository but not sure.

In the pom.xml

  1. modeshape-jcr
  2. modeshape-jcr-api
  3. modeshape-schematic
  4. modeshape-bom-embedded
  5. infinispan-core

In the repo.json

{
   "name":"repo",
   "workspaces":{
      "default":"default",
      "allowCreation":true
   },
    "security":{"providers" : [
            {
                "name" : "Custom Provider",
                "classname" : "security.CustomRepoAuthProvider"
            }
        ]
      },
   "storage":{
      "cacheConfiguration":"/conf/infinispan-conf.xml",
      "cacheName":"filesystem"
   }
}

In the infinispan-conf.xml

http://www.infinispan.org/schemas/infinispan-config-5.3.xsd">

<global>
    <globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
</global>
<namedCache name="filesystem">
    <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC"/>
    <loaders passivation="false" shared="false" preload="true">
        <fileStore fetchPersistentState="true" purgerThreads="3" purgeSynchronously="true" ignoreModifications="false" purgeOnStartup="false" location="/lfs/enve/apps/tomcat/temp/">
            <async enabled="true" flushLockTimeout="15000" threadPoolSize="5" />
            <singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000" />
        </fileStore>
    </loaders>
</namedCache>

Any body help me???


Solution

  • In the infinispan-conf.xml made following changes

    http://www.infinispan.org/schemas/infinispan-config-5.3.xsd">

        <global>
            <globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
        </global>
        <namedCache name="filesystem">
            <locking isolationLevel="READ_COMMITTED"/>
            <transaction
                    transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
                    transactionMode="TRANSACTIONAL"
                    lockingMode="PESSIMISTIC"/>
            <loaders
                    passivation="false"
                    shared="false"
                    preload="true">
                <loader
                        class="org.infinispan.loaders.file.FileCacheStore"
                        fetchPersistentState="true"
                        ignoreModifications="false"
                        purgeOnStartup="false">
                    <properties>
                        <property name="location" value="/lfs/envd/apps/tomcat/temp/"/>
                    </properties>
                </loader>
            </loaders>
        </namedCache>