6 Replies Latest reply on Nov 8, 2014 12:13 AM by Nguyen Thanh

    How to use the "db-binary-storage" option in MS3 Beta3 / Jboss AS 7.1.1

    Chris Poulsen Newbie

      Hi,

       

      I've managed to get MS3 Beta3 up and running in Jboss AS 7.1.1.

       

      I'd like to try out the "db-binary-storage" but I'm unable to get Jboss AS to accept the configuration... It keeps claiming that the datasource jndi name is null.

       

      The output looks like this when attempting to set it from the CLI:

       

      [standalone@localhost:9999 /] /subsystem=modeshape/repository=author_repository/configuration=binary-storage/storage-type=db-binary-storage:add(data-source-jndi-name=java:/DezideWebAuthor2DB)

      {

          "outcome" => "failed",

          "failure-description" => "JBAS014746: data-source-jndi-name may not be null",

          "rolled-back" => true

      }

       

       

      I use the datasource in an Infinispan cache loader, so it is working (I've also tried stripping the "java:/" without success).

       

      Does anyone have this working?

       

      --

      Chris

        • 1. Re: How to use the "db-binary-storage" option in MS3 Beta3 / Jboss AS 7.1.1
          Randall Hauch Master

          Please bear with us -- this is a new feature that was just added in Beta3, so we might not have found all the issues.

           

          Can you post either the relevant parts of your AS7 configuration (e.g., data sources and modeshape subsystems), and/or the CLI session you used for the configuration?

          • 2. Re: How to use the "db-binary-storage" option in MS3 Beta3 / Jboss AS 7.1.1
            Chris Poulsen Newbie

            Hi,

             

            Btw. we experienced quite some problems with MS2 and large binaries, from what I've tested with MS3 and the binary file storage so far, it looks like a immense improvement over MS2. So we're quite excited!

             

            Datasources:

             

            {code:xml}

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

                <datasources>

                    <datasource jta="false" jndi-name="java:/DezideWebAuthor2DB" pool-name="DezideWebAuthor2DB" enabled="true" use-ccm="false">

                        <connection-url>jdbc:oracle:thin:@//localhost:1521/xe</connection-url>

                        <driver-class>oracle.jdbc.OracleDriver</driver-class>

                        <driver>oracle</driver>

                        <security>

                            <user-name>qwerty</user-name>

                            <password>asdfgh</password>

                        </security>

                        <validation>

                            <validate-on-match>false</validate-on-match>

                            <background-validation>false</background-validation>

                        </validation>

                        <statement>

                            <share-prepared-statements>false</share-prepared-statements>

                        </statement>

                    </datasource>

                    <drivers>

                        <driver name="oracle" module="com.oracle.jdbc">

                            <driver-class>oracle.jdbc.OracleDriver</driver-class>

                        </driver>

                    </drivers>

                </datasources>

            </subsystem>

            {code}

             

            Infinispan:

             

            {code:xml}

            <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">

                <cache-container name="webauthor" default-cache="webauthor_cache">

                    <local-cache name="webauthor_cache">

                        <transaction mode="NON_XA" locking="OPTIMISTIC"/>

                        <string-keyed-jdbc-store datasource="java:/DezideWebAuthor2DB" shared="false" preload="false" passivation="false" fetch-state="false" purge="false">

                            <string-keyed-table prefix="WA_MS3">

                                <id-column name="ID_COLUMN" type="VARCHAR2(255)"/>

                                <data-column name="DATA_COLUMN" type="BLOB"/>

                                <timestamp-column name="TIMESTAMP_COLUMN" type="NUMBER"/>

                            </string-keyed-table>

                        </string-keyed-jdbc-store>

                    </local-cache>

                </cache-container>

            </subsystem>

            {code}

             

            And modeshape:

             

            {code:xml}

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

                <repository name="author_repository" cache-name="webauthor_cache" cache-container="webauthor" jndi-name="java:/jcr/local" use-anonymous-upon-failed-authentication="true">

                    <workspaces>

                        <workspace name="default"/>

                        <workspace name="system"/>

                    </workspaces>

                </repository>

            </subsystem>

            {code}

             

            --

            Chris

            • 3. Re: How to use the "db-binary-storage" option in MS3 Beta3 / Jboss AS 7.1.1
              Randall Hauch Master

              Thanks, Chris.

              Btw. we experienced quite some problems with MS2 and large binaries, from what I've tested with MS3 and the binary file storage so far, it looks like a immense improvement over MS2. So we're quite excited!

              We are, too!

               

              BTW, we have several binary storage options: file system, Infinispan, database (via JDBC), MongoDB, and (in Beta4) custom implementations. The file system binary store has been in ModeShape 3 from almost the very beginning and is probably the most stable; the others are pretty new. All have different advantages and sweet spots, and we've not yet done performance comparisons on any of them. So be sure to consider which one(s) might be a good fit for your application. If you have any questions, please let us know.

               

              The data source and Infinispan subsystems look good, but the ModeShape subsystem is missing a binary storage configuration. If you want to use a database for binary storage, your ModeShape subsystem will need a "db-binary-storage" element, which should look something like the following:

               

              <subsystem xmlns="urn:jboss:domain:modeshape:1.0">
                  <repository name="author_repository" cache-name="webauthor_cache" cache-container="webauthor" 
                              jndi-name="java:/jcr/local" use-anonymous-upon-failed-authentication="true">
                      <workspaces>
                          <workspace name="default"/>
                          <workspace name="system"/>
                      </workspaces>
                      <db-binary-storage data-source-jndi-name="java:/DezideWebAuthor2DB" min-value-size="4096"/>
                  </repository>
              </subsystem>
              

               

              Note the "min-value-size" attribute is optional, and defaults to "4096" bytes. See our subsystem schema for more information, which you can find in our codebase or in the "docs/schema" directory of the AS7 installation (the "modeshape_1_0.xsd" is added by our kit).

              • 4. Re: How to use the "db-binary-storage" option in MS3 Beta3 / Jboss AS 7.1.1
                Chris Poulsen Newbie

                Hi,

                 

                Yes I know that I have to add the <db-binary-storage data-source.... /> the problem is that Jboss AS 7.1.1 complains about the NULL datasource and then removes the element from the file (during app server boot)

                 

                This happens both when i manually edit the file and when I add the storage option using the CLI.

                 

                --

                Chris

                • 5. Re: How to use the "db-binary-storage" option in MS3 Beta3 / Jboss AS 7.1.1
                  Randall Hauch Master

                  Ah, right. Can you log an issue? We'll get this fixed before the next beta release.

                  • 6. Re: How to use the "db-binary-storage" option in MS3 Beta3 / Jboss AS 7.1.1
                    Nguyen Thanh Newbie

                    Hi,

                    I use the datasource in an Infinispan cache loader ( datasource is hadoop hive), but it is not work. How to configure modeshape using datasource hadoop?

                    Thank you so much!


                    -------

                    Thanh.