Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1609

Storing indexes and binary values in cache or JDBC database not working in AS7

XMLWordPrintable

    Configuring a repository to store its index into an infinispan cache backed by a jdbc cache loader doesn't work. The database tables for the index are not created and used and the index filesystem directory is still created and used. Effectively the cache-index-storage element in the repository configuration is completely ignored.

    The configuration I am using (in standalone-modeshape.xml) is as follows:

            <subsystem xmlns="urn:jboss:domain:infinispan:1.4">
                <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">
                    <local-cache name="entity">
                        <transaction mode="NON_XA"/>
                        <eviction strategy="LRU" max-entries="10000"/>
                        <expiration max-idle="100000"/>
                    </local-cache>
                    <local-cache name="local-query">
                        <transaction mode="NONE"/>
                        <eviction strategy="LRU" max-entries="10000"/>
                        <expiration max-idle="100000"/>
                    </local-cache>
                    <local-cache name="timestamps">
                        <transaction mode="NONE"/>
                        <eviction strategy="NONE"/>
                    </local-cache>
                </cache-container>
                <!-- Each ModeShape repository uses one (or more) cache in a cache container. We define a single container
                     named "modeshape" (other names require specifying the container names in each repository configuration,
                     with a "sample" cache (each repository assumes the cache name matches the repository name). -->
                <cache-container name="modeshapeCache">
                    <local-cache name="testRepositoryCache">
                        <transaction mode="NON_XA"/>
                        <string-keyed-jdbc-store datasource="jboss/datasources/JcrDataDS" passivation="false" purge="false">
                            <property name="databaseType">
                                postgres
                            </property>
                            <property name="createTableOnStart">
                                true
                            </property>
                            <string-keyed-table prefix="stringbased">
                                <id-column name="id" type="VARCHAR(200)"/>
                                <data-column name="datum" type="BYTEA"/>
                                <timestamp-column name="version" type="BIGINT"/>
                            </string-keyed-table>
                        </string-keyed-jdbc-store>
                    </local-cache>
                </cache-container>            
                <cache-container name="modeshapeIndexCache">
                    <local-cache name="testRepository-index-locks">
                        <transaction mode="NON_XA"/>
                        <string-keyed-jdbc-store datasource="jboss/datasources/JcrDataDS" passivation="false" purge="false">
                            <property name="databaseType">
                                postgres
                            </property>
                            <property name="createTableOnStart">
                                true
                            </property>
                            <string-keyed-table prefix="stringbased">
                                <id-column name="id" type="VARCHAR(200)"/>
                                <data-column name="datum" type="BYTEA"/>
                                <timestamp-column name="version" type="BIGINT"/>
                            </string-keyed-table>
                        </string-keyed-jdbc-store>
                    </local-cache>
                    <local-cache name="testRepository-index-data">
                        <transaction mode="NON_XA"/>
                        <string-keyed-jdbc-store datasource="jboss/datasources/JcrDataDS" passivation="false" purge="false">
                            <property name="databaseType">
                                postgres
                            </property>
                            <property name="createTableOnStart">
                                true
                            </property>
                            <string-keyed-table prefix="stringbased">
                                <id-column name="id" type="VARCHAR(200)"/>
                                <data-column name="datum" type="BYTEA"/>
                                <timestamp-column name="version" type="BIGINT"/>
                            </string-keyed-table>
                        </string-keyed-jdbc-store>
                    </local-cache>
                    <local-cache name="testRepository-index-metadata">
                        <transaction mode="NON_XA"/>
                        <string-keyed-jdbc-store datasource="jboss/datasources/JcrDataDS" passivation="false" purge="false">
                            <property name="databaseType">
                                postgres
                            </property>
                            <property name="createTableOnStart">
                                true
                            </property>
                            <string-keyed-table prefix="stringbased">
                                <id-column name="id" type="VARCHAR(200)"/>
                                <data-column name="datum" type="BYTEA"/>
                                <timestamp-column name="version" type="BIGINT"/>
                            </string-keyed-table>
                        </string-keyed-jdbc-store>
                    </local-cache>
                </cache-container>
            </subsystem>
            <subsystem xmlns="urn:jboss:domain:modeshape:1.0">
                <repository name="testRepository" cache-name="testRepositoryCache" cache-container="modeshapeCache">
                    <indexing rebuild-upon-startup="if_missing" mode="sync"/>
                    <cache-index-storage cache-container-jndi-name="modeshapeIndexCache" 
                                 lock-cache-name="testRepository-index-locks" 
                                 data-cache-name="testRepository-index-data"
                                 metadata-cache-name="testRepository-index-metadata"/>
                </repository>
            </subsystem>
    

    The log output on starting to use the repository is:

    �[0m�[0m23:46:20,793 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (http-localhost/127.0.0.1:8080-1) Deploying javax.ws.rs.core.Application: class au.com.infomedix.jcrloadtest.jcrserver.restapi.JcrLoadTestApplication
    �[0m�[0m23:46:21,008 INFO  [org.infinispan.factories.GlobalComponentRegistry] (http-localhost/127.0.0.1:8080-1) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.6.FINAL
    �[0m�[0m23:46:21,367 INFO  [org.infinispan.jmx.CacheJmxRegistration] (http-localhost/127.0.0.1:8080-1) ISPN000031: MBeans were successfully registered to the platform mbean server.
    �[0m�[0m23:46:21,369 INFO  [org.jboss.as.clustering.infinispan] (http-localhost/127.0.0.1:8080-1) JBAS010281: Started testRepositoryCache cache from modeshapeCache container
    �[0m�[33m23:46:22,758 WARNING [org.modeshape.jcr.RepositoryConfiguration$Component] (http-localhost/127.0.0.1:8080-1) The field name is not present on org.modeshape.jcr.security.ServletProvider or any of its super types
    �[0m�[0m23:46:22,867 INFO  [org.hibernate.search.Version] (http-localhost/127.0.0.1:8080-1) HSEARCH000034: Hibernate Search 4.1.1.Final
    �[0m�[0m23:46:22,897 INFO  [org.hibernate.annotations.common.Version] (http-localhost/127.0.0.1:8080-1) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
    �[0m�[33m23:46:22,956 WARN  [org.hibernate.search.store.impl.DirectoryProviderHelper] (http-localhost/127.0.0.1:8080-1) HSEARCH000041: Index directory not found, creating: '/Users/bwallis/InfoMedix/JBoss/ModeShape/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/data/modeshape/testRepository/testRepository/indexes'
    �[0m�[33m23:46:22,957 WARN  [org.hibernate.search.store.impl.DirectoryProviderHelper] (http-localhost/127.0.0.1:8080-1) HSEARCH000041: Index directory not found, creating: '/Users/bwallis/InfoMedix/JBoss/ModeShape/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/data/modeshape/testRepository/testRepository/indexes/nodeinfo'
    �[0m�[0m23:46:23,057 INFO  [org.hibernate.search.indexes.serialization.avro.impl.AvroSerializationProvider] (http-localhost/127.0.0.1:8080-1) HSEARCH000079: Serialization protocol version 1.0
    �[0m�[0m23:46:23,408 INFO  [au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService] (http-localhost/127.0.0.1:8080-1) Registering the JCR schema.
    �[0m�[0m23:46:24,836 INFO  [au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService] (http-localhost/127.0.0.1:8080-1) Completed Registeration the JCR schema.
    

            hchiorean Horia Chiorean (Inactive)
            bwallis42_jira Brian Wallis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: