1 2 Previous Next 25 Replies Latest reply on Aug 28, 2012 7:06 PM by bwallis42 Go to original post
      • 15. Re: JDBC configuration in AS7.1.1
        rhauch

        The only other thing I can think of trying is to use the JdbcBinaryCacheStore to see if there's any difference re the TransactionManager; see the Infinispan documentation.

         

        Have you asked in the Infinispan forums whether there are any known issues with setting up a cache with the JDBC cache store on AS 7.1 (or even 7.1.2)? Surely they know about the issue, can identify the problem, or offer some suggestions.

        • 16. Re: JDBC configuration in AS7.1.1
          bwallis42

          Posted a question to the infinispan forums after a day of playing with various configurations. If I leave the JDBC configuration out then I get a transaction manager, if I put it in then I get null. The string-keyed-jdbc-store (or binary-) seems to break the configuration and I end up with a default configuration cache.

          • 17. Re: JDBC configuration in AS7.1.1
            rhauch

            Can you post a link to the Infinispan forum discussion?

            • 18. Re: JDBC configuration in AS7.1.1
              bwallis42

              Sorry, meant to do that in my last post, https://community.jboss.org/thread/204266

              • 19. Re: JDBC configuration in AS7.1.1
                bwallis42

                Moved a step forward (but not very far forward) as described in the linked infinispan discussion. Basically, removed the "java:" from the datasource reference string. Configuration I am using now is

                {code}

                            <cache-container name="modeshapeCache" default-cache="default">

                                <local-cache name="testRepositoryCache">

                                    <transaction mode="FULL_XA"/>

                                    <string-keyed-jdbc-store datasource="jboss/datasources/JcrDataDS" preload="false" 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>

                {code}

                 

                but now I have the transaction problem discussed in https://community.jboss.org/thread/203989 and it is unlikely I will get a solution to this for a while.

                 

                JBoss AS 7.2.0.Alpha1 should have a workaround for this as it is using a later version of infinispan (5.1.6 at present) but I couldn't get modeshape to deploy in 7.2.0 due to a method signature change as described earlier in this thread.

                 

                P.S. The createTableOnStart property didn't work either, it got an error when it tried that is probably related to the ISPN-604 issue, I created the table manually to get by that problem.

                1 of 1 people found this helpful
                • 20. Re: JDBC configuration in AS7.1.1
                  rhauch

                  Thanks again, Brian, for fighting your way through this. Glad to hear that the JNDI name change fixed the data source lookup issue in Infinispan.

                   

                  We committed a change yesterday that improved the internals of ModeShape's subsystem for AS7 to use the latest conventions, and hopefully that will help when deploying to 7.2.x. However, I'll try building locally against 7.2.0-SNAPSHOT and fix any issues I encounter.

                  • 21. Re: JDBC configuration in AS7.1.1
                    rhauch

                    Regarding installation into JBoss AS7.2, I just committed a change that will produce ModeShape kits for both JBoss AS7.1 and 7.2 (even though there haven't been any official releases of 7.2 yet); see MODE-1605. The modules were enough of a difference that it warranted a separate kit. It is also possible to build ModeShape to Infinispan 5.1.5.FINAL and JGroups 3.1.0.Final (the same versions that are in the current codebase of 7.2) and test against 7.2.0.Alpha1-SNAPSHOT.

                     

                    To run such tests, you'll need to get the AS7 code from GitHub, build it locally with "mvn clean install -Prelease -DskipTests", and then get the ModeShape code from GitHub, and run this build command:

                     

                         $ mvn clean install -s settings.xml -Passembly,as72

                     

                    The new kit for 7.2 will be included in the Beta3 release (which I'm building as we speak).

                    • 22. Re: JDBC configuration in AS7.1.1
                      bwallis42

                      As discussed in this thread:  3.0.0 Beta 3 JBoss as kit for 7.2 won't start I have manged to get beta 3 running in a recent jboss 7.2.0.Alpha1 snapshot and now i am getting my repository stored into the database! (yay)

                       

                      The configuration I have settled on for that is:

                       

                      {code}

                              <subsystem xmlns="urn:jboss:domain:infinispan:1.4">

                                  <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">

                        ...

                                  </cache-container>

                                  <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>           

                              </subsystem>

                              <subsystem xmlns="urn:jboss:domain:modeshape:1.0">

                                  <repository name="testRepository" cache-name="testRepositoryCache" cache-container="modeshapeCache">

                                  </repository>

                              </subsystem>

                      {code}

                       

                      and this is creating the db table stringbased-testRepositoryCache on startup and is persisting the repository elements into this table.

                       

                      So next I thought I would try puting the indexes into a cache that is also persisted into the database using the following updated configuration:

                       

                       

                      {code}

                              <subsystem xmlns="urn:jboss:domain:infinispan:1.4">

                                  <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">

                         ...

                                  </cache-container>

                                  <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"/>

                                  </repository>

                              </subsystem>

                       

                      {code}

                      So there is an additional cache container called "modeshapeIndexCache" in which there are three caches defined for each part of the index (as documented in the modeshape xsd file) and the addition of indexing and cache-index-storage elements to the modeshape repository definition.

                       

                      This just seems to be ignored and the index is still created in the filesystem at the default location.

                       

                      Any idea what I might be doing wrong for this? Can I get the indexes stored in the database?

                       

                      thanks,

                      • 23. Re: JDBC configuration in AS7.1.1
                        rhauch

                        As discussed in this thread:  3.0.0 Beta 3 JBoss as kit for 7.2 won't start I have manged to get beta 3 running in a recent jboss 7.2.0.Alpha1 snapshot and now i am getting my repository stored into the database! (yay)

                        Fantastic!

                         

                         

                        So there is an additional cache container called "modeshapeIndexCache" in which there are three caches defined for each part of the index (as documented in the modeshape xsd file) and the addition of indexing and cache-index-storage elements to the modeshape repository definition.

                         

                        This just seems to be ignored and the index is still created in the filesystem at the default location.

                         

                        The configuration of the ModeShape repository does include the "cache-container-jndi-name" correctly, and that should be enough given your three caches are named in the same pattern as the expected by the defaults for the three attributes. Have you tried explicitly adding the attributes that specify the names of the three caches? For example:

                         

                                <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>
                        

                         

                        This is clearly a bug, but hopefully this will work around the problem. Regardless, can you file a bug in JIRA?

                        • 24. Re: JDBC configuration in AS7.1.1
                          bwallis42

                          Tried the explicit naming of the caches but still not working. I've created jira  MODE-1609 for the problem.

                          • 25. Re: JDBC configuration in AS7.1.1
                            bwallis42

                            Note that all of my local-cache definitions are missing an eviction element. Leaving this out means you run out of memory once you run a bit of data into the repository as I did last night

                             

                            So, I have added eviction lines like so to my repository cache:

                             

                            {code}

                                                <eviction strategy="LIRS" max-entries="1000"/>

                            {code}

                             

                            which is sized to hold about 125 documents (600K of document data and about 8 nodes per document) in my particular schema and use about 60M of heap. I've assumed there is a cache entry per node, is this correct or are there entries per node and per attribute?

                             

                            I also added entries to the index caches

                             

                            {code}

                                                <eviction strategy="LIRS" max-entries="2000"/>

                            {code}

                             

                            but this is a simple guess as I have no idea how much space an entry uses on average or how many entries you should use for each of the three index caches (but since this isn't working yet it doesn't really matter much).

                            1 2 Previous Next