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

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

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 3.0.0.Beta3
    • Fix Version/s: 3.0.0.CR3
    • Component/s: Query, Search, Storage
    • Labels:
      None
    • Environment:

      Mac OSX 10.6.8, Java JDK 1.6.0_33, JBoss AS 7.2.0.Alpha1 snapshot 24/8/12

      Description

      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:

      23: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
      23: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
      23: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.
      23:46:21,369 INFO  [org.jboss.as.clustering.infinispan] (http-localhost/127.0.0.1:8080-1) JBAS010281: Started testRepositoryCache cache from modeshapeCache container
      23: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
      23:46:22,867 INFO  [org.hibernate.search.Version] (http-localhost/127.0.0.1:8080-1) HSEARCH000034: Hibernate Search 4.1.1.Final
      23: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}
      23: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'
      23: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'
      23: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
      23:46:23,408 INFO  [au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService] (http-localhost/127.0.0.1:8080-1) Registering the JCR schema.
      23:46:24,836 INFO  [au.com.infomedix.jcrloadtest.jcrserver.repo.JcrService] (http-localhost/127.0.0.1:8080-1) Completed Registeration the JCR schema.
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                hchiorean Horia Chiorean
                Reporter:
                bwallis42 Brian Wallis
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: