1 2 Previous Next 26 Replies Latest reply on May 2, 2014 5:50 AM by Ant DASS LEYO

    mode shape with sql server

    Ant DASS LEYO Newbie

      Hello,

      I'm well struggling with this new technology and i dont have any help around.

      With the help of some experts i have some global idea

      on start the engine ; create a session and create nodes save the session and shut down the engine.

      i want to know how he makes the link with the database.

      i have created the nodes.

      1 -- i have installed sql jdbc with the help of maven ---

      2 -- i have added the dependencyin pom.xml file.

      3 -- i want to know should i do things in config.json -----

      4 --  what should i do in infinspan.xml

      5 --  how they store in database (either by an insert)

      i need badly a help.

      thanks for ypur precious help.....................

        • 1. Re: mode shape with sql server
          Randall Hauch Master

          ModeShape is designed to store the nodes in a database, but how it does that is really an implementation detail. (The code is open source, and you can always figure this out. But you are not required to know how ModeShape does this.) Your application should only use ModeShape's public API to create, modify, and access content.

           

          You configure ModeShape via a JSON file, and you configure Infinispan via an XML file. The names of these files can actually be anything, though your code may need to reference the JSON file and the JSON file will need to reference the XML file.

           

          Please see https://github.com/ModeShape/modeshape-examples/tree/master/modeshape-jdbc-store-example, and try to get THAT example working as-is with SQL Server by referencing the SQLServer JDBC driver in the POM file and changing the JDBC connection properties in the https://github.com/ModeShape/modeshape-examples/blob/master/modeshape-jdbc-store-example/src/main/resources/infinispan-configuration.xml (around line 13) to point to your SQLServer database. As pointed out to you in the other discussion thread, you can use one of our test configurations for Infinispan as an example of how to modify the "infinispan-configuration.xml" file.

          1 of 1 people found this helpful
          • 2. Re: mode shape with sql server
            Ant DASS LEYO Newbie

            thank you for your reply.

            COncerning the infinispan ; i would like to that i shoud te installation on windows and add" something" in the environement variable or else just my

            INFINISPAN-CONFIGURATION.XML is enough ?

             

             

            i have the followin error :


             

            javax.jcr.RepositoryException: Error while starting 'Persisted-Repository' repository: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,36]

            Message: Unexpected element '{urn:infinispan:config:6.0}infinispan' encountered

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:613)

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:580)

                at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:149)




            INFINISPAN-CONFIGURATION.XML

             

            <?xml version="1.0" encoding="UTF-8"?>

            <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd

                                    urn:infinispan:config:jdbc:6.0 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-6.0.xsd"

                xmlns="urn:infinispan:config:6.0">

                <namedCache name="persisted_repository">

                    <transaction

                        transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"

                        transactionMode="TRANSACTIONAL" lockingMode="PESSIMISTIC" />

                    <persistence>

                        <stringKeyedJdbcStore xmlns="urn:infinispan:config:jdbc:6.0"

                            fetchPersistentState="false" ignoreModifications="false"

                            purgeOnStartup="false">

                            <connectionPool

                                connectionUrl="jdbc:sqlserver://localhost:1433;DatabaseName=modeshape"

                                driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"

                                username="sa1" password="sa" />

                            <stringKeyedTable prefix="ISPN_STRING_TABLE"

                                createOnStart="true" dropOnExit="false">

                                <idColumn name="ID_COLUMN" type="NVARCHAR(400)" />

                                <dataColumn name="DATA_COLUMN" type="IMAGE" />

                                <timestampColumn name="TIMESTAMP_COLUMN" type="BIGINT" />

                            </stringKeyedTable>

                        </stringKeyedJdbcStore>

                    </persistence>

                </namedCache>

            </infinispan>

             

            JSON

             

            {

                "name" : "Persisted-Repository",

                "workspaces" : {

                    "predefined" : ["otherWorkspace"],

                    "default" : "default",

                    "allowCreation" : true

                },

               

                "security" : {

                    "anonymous" : {

                        "roles" : ["readonly","readwrite","admin"],

                        "useOnFailedLogin" : false

                    }

                },

               

                "storage" : {

                    "cacheConfiguration" : "infinispan_config.xml",

                    "cacheName" : "persisted_repository",

                    "binaryStorage" : {

                        "type" : "file",

                        "directory": "target/content/binaries",

                        "minimumBinarySizeInBytes" : 999

                    }

                },

               

                 "query":{

                    "enabled":true,

                    "rebuildUponStartup":"if_missing",

                    "indexStorage": {

                        "type":"filesystem",

                        "location":"target/content/index",

                        "lockingStrategy":"simple",

                        "fileSystemAccessType":"auto"

                    }

                },

            }

            • 3. Re: mode shape with sql server
              Randall Hauch Master

              ModeShape 3.x must use Infinispan 5.x. Please read the documentation and Getting Started guide.

              1 of 1 people found this helpful
              • 4. Re: mode shape with sql server
                Ant DASS LEYO Newbie

                i have a doubt int the version of modeshpae installed

                 

                when i compile my program :

                 

                 

                 

                i know this comes from POM.xml and if i chage the version i have an error in modeengine.


                <modeshape.version>3.1.1.Final</modeshape.version>

                 

                in my eclipse i have this version :

                 

                which one is correct

                 

                advance thanks

                • 5. Re: mode shape with sql server
                  Randall Hauch Master

                  Please upgrade via your POM to a newer version of ModeShape. The latest production-ready release is 3.7.3.Final, which is almost 2 years newer than what you are using. Again, I'm going to point you to our documentation that covers how to use Maven to set up your POM. Also, please look again at all of our examples (there are instructions on that page).

                   

                  Please note that ModeShape Tools is merely a set of client-side tools and does not include the ModeShape repository or server libraries, nor does it help you create your Maven projects in Eclipse by automatically adding the ModeShape dependencies.

                  • 6. Re: mode shape with sql server
                    Ant DASS LEYO Newbie

                    i'm exaclty doing what is mentioned in the page

                    Getting Started - ModeShape 3 - Project Documentation Editor

                     

                    once i change the version in my pom ;

                     

                     

                     

                    the main main program has an error at main program

                     

                     

                    i read always the same doc.

                    • 7. Re: mode shape with sql server
                      Randall Hauch Master

                      What about the other parts of the POM file that mention ModeShape? Where are you declaring the actual dependency? If you're using Eclipse, you should be able to expand the "Maven Dependencies" under your project folder and see ModeShape.

                       

                      Have you tried downloading, compiling and running the examples? Once again, your POM file (at least the ModeShape-specific parts of it) will not look that different from these examples:

                       

                          <dependencyManagement>  

                              <dependencies>

                                  <!-- Import the ModeShape BOM for embedded usage. This adds to the "dependenciesManagement" section

                        defaults for all of the modules we might need, but we still have to include in the

                        "dependencies" section the modules we DO need. The benefit is that we don't have to

                        specify the versions of any of those modules.-->

                                  <dependency>

                                      <groupId>org.modeshape.bom</groupId>

                                      <artifactId>modeshape-bom-embedded</artifactId>

                                      <version>${modeshape.version}</version>

                                      <type>pom</type>

                                      <scope>import</scope>

                                  </dependency>

                              </dependencies>

                          </dependencyManagement>

                          <dependencies>

                              <dependency>

                                  <groupId>org.modeshape</groupId>

                                  <artifactId>modeshape-jcr-api</artifactId>

                              </dependency>

                              <dependency>

                                  <groupId>org.modeshape</groupId>

                                  <artifactId>modeshape-jcr</artifactId>

                              </dependency>

                              <dependency>

                                  <groupId>org.modeshape</groupId>

                                  <artifactId>modeshape-common</artifactId>

                              </dependency>

                              <!--This examples uses Infinispan's JDBC cache store, which requires C3P0 and a JDBC database driver -->

                              <dependency>

                                  <groupId>org.infinispan</groupId>

                                  <artifactId>infinispan-cachestore-jdbc</artifactId>

                              </dependency>

                              <dependency>

                                  <groupId>c3p0</groupId>

                                  <artifactId>c3p0</artifactId>

                                  <version>${c3p0.version}</version>

                              </dependency>

                              <dependency>

                                  <groupId>com.h2database</groupId>

                                  <artifactId>h2</artifactId>

                                  <version>${jdbc.h2.version}</version>

                              </dependency>


                      • 8. Re: mode shape with sql server
                        Ant DASS LEYO Newbie

                        am i limited with 2 messages ; i'm blicked with an error message as if i'm disconnected.

                         

                        this is pom.xml ( i took all the three from your page)

                         

                        <?xml version="1.0"?>

                         

                        <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

                         

                            <modelVersion>4.0.0</modelVersion>

                         

                            <groupId>org.modeshape.example</groupId>

                         

                            <artifactId>modeshape-basic-example</artifactId>

                         

                            <packaging>jar</packaging>

                         

                            <name>Modeshape simple example</name>

                         

                            <description>A simple example application that stores one image in a JCR repository and later retrieves it.</description>

                         

                            <version>1.0-SNAPSHOT</version>

                         

                            <properties>

                         

                                <!-- Instruct the build to use only UTF-8 encoding for source code -->

                         

                                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

                         

                                <!--

                         

                                Global dependency version information

                         

                                -->

                         

                                <modeshape.version>3.1.1.Final</modeshape.version>

                         

                                <!--

                         

                                Maven plugin versions

                         

                                -->

                         

                                <maven.surefire.report.plugin.version>2.4.3</maven.surefire.report.plugin.version>

                         

                                <maven.surefire.plugin.version>2.7.1</maven.surefire.plugin.version>

                         

                                <maven.assembly.plugin.version>2.2</maven.assembly.plugin.version>

                         

                                <maven.install.plugin.version>2.3.1</maven.install.plugin.version>

                         

                                <maven.jar.plugin.version>2.3.1</maven.jar.plugin.version>

                         

                                <maven.compiler.plugin.version>2.3.2</maven.compiler.plugin.version>

                         

                                <maven.source.plugin.version>2.1.2</maven.source.plugin.version>

                         

                                <maven.resources.plugin.version>2.4.3</maven.resources.plugin.version>

                         

                            </properties>

                         

                          <dependencyManagement>   

                         

                              <dependencies>

                         

                                  <!-- Import the ModeShape BOM for embedded usage. This adds to the "dependenciesManagement" section

                         

                                       defaults for all of the modules we might need, but we still have to include in the

                         

                                       "dependencies" section the modules we DO need. The benefit is that we don't have to

                         

                                       specify the versions of any of those modules.-->

                         

                                  <dependency>

                         

                                      <groupId>org.modeshape.bom</groupId>

                         

                                      <artifactId>modeshape-bom-embedded</artifactId>

                         

                                      <version>${modeshape.version}</version>

                         

                                      <type>pom</type>

                         

                                      <scope>import</scope>

                         

                                  </dependency>

                         

                              </dependencies>

                         

                          </dependencyManagement>

                         

                          <dependencies>

                         

                              <!-- This module is **explicitly** using a number of other modules, so we have to include

                         

                                   them in the "dependencies" section. However, since we imported the ModeShape BOM in the

                         

                                   "dependencyManagement" section, we don't have to include "scope" or "version". -->

                         

                              <dependency>

                         

                                  <groupId>javax.jcr</groupId>

                         

                                  <artifactId>jcr</artifactId>

                         

                              </dependency>

                         

                              <dependency>

                         

                                  <groupId>org.modeshape</groupId>

                         

                                  <artifactId>modeshape-jcr</artifactId>

                         

                              </dependency>

                         

                            

                         

                              <!-- Logging will use Log4J -->

                         

                              <dependency>

                         

                                  <groupId>log4j</groupId>

                         

                                  <artifactId>log4j</artifactId>

                         

                              </dependency>

                         

                              <!-- Use JUnit for testing -->

                         

                              <dependency>

                         

                                  <groupId>junit</groupId>

                         

                                  <artifactId>junit</artifactId>

                         

                              </dependency>

                         

                          </dependencies>

                         

                            <build>

                         

                                <resources>

                         

                                    <resource>

                         

                                        <directory>src/main/resources</directory>

                         

                                    </resource>

                         

                                    <resource>

                         

                                        <directory>src/main/java</directory>

                         

                                        <includes>

                         

                                            <include>**</include>

                         

                                        </includes>

                         

                                        <excludes>

                         

                                            <exclude>**/*.java</exclude>

                         

                                        </excludes>

                         

                                    </resource>

                         

                                </resources>

                         

                                <pluginManagement>

                         

                                    <plugins>

                         

                                        <plugin>

                         

                                            <groupId>org.apache.maven.plugins</groupId>

                         

                                            <artifactId>maven-surefire-plugin</artifactId>

                         

                                            <configuration>

                         

                                                <includes>

                         

                                                    <include>**/*Test.java</include>

                         

                                                </includes>

                         

                                            </configuration>

                         

                                        </plugin>

                         

                                    </plugins>

                         

                                </pluginManagement>

                         

                                <plugins>

                         

                                    <!-- Specify the compiler options and settings -->

                         

                                    <plugin>

                         

                                        <groupId>org.apache.maven.plugins</groupId>

                         

                                        <artifactId>maven-compiler-plugin</artifactId>

                         

                                        <version>${maven.compiler.plugin.version}</version>

                         

                                        <configuration>

                         

                                            <source>1.6</source>

                         

                                            <target>1.6</target>

                         

                                            <showDeprecation>false</showDeprecation>

                         

                                            <showWarnings>false</showWarnings>

                         

                                        </configuration>

                         

                                    </plugin>

                         

                                    <plugin>

                         

                                        <artifactId>maven-surefire-plugin</artifactId>

                         

                                        <version>${maven.surefire.plugin.version}</version>

                         

                                        <configuration>

                         

                                            <includes>

                         

                                                <include>**/*TestCase.java</include>

                         

                                                <include>**/*Test.java</include>

                         

                                            </includes>

                         

                                        </configuration>

                         

                                    </plugin>

                         

                                    <!-- Produce source jars during the 'verify' phase -->

                         

                                    <plugin>

                         

                                        <groupId>org.apache.maven.plugins</groupId>

                         

                                        <artifactId>maven-source-plugin</artifactId>

                         

                                        <version>${maven.source.plugin.version}</version>

                         

                                        <executions>

                         

                                            <execution>

                         

                                                <id>attach-sources</id>

                         

                                                <phase>verify</phase>

                         

                                                <goals>

                         

                                                    <goal>jar</goal>

                         

                                                </goals>

                         

                                            </execution>

                         

                                        </executions>

                         

                                    </plugin>

                         

                                    <!--

                         

                                        Build a test-jar for each project, so that src/test/* resources and

                         

                                        classes can be used in other projects. Also customize how the jar

                         

                                        files are assembled.

                         

                                    -->

                         

                                    <plugin>

                         

                                        <groupId>org.apache.maven.plugins</groupId>

                         

                                        <artifactId>maven-jar-plugin</artifactId>

                         

                                        <version>${maven.jar.plugin.version}</version>

                         

                                        <executions>

                         

                                            <execution>

                         

                                                <id>test-jar</id>

                         

                                                <goals>

                         

                                                    <goal>test-jar</goal>

                         

                                                </goals>

                         

                                            </execution>

                         

                                        </executions>

                         

                                    </plugin>

                         

                                    <plugin>

                         

                                        <groupId>org.apache.maven.plugins</groupId>

                         

                                        <artifactId>maven-resources-plugin</artifactId>

                         

                                        <version>${maven.resources.plugin.version}</version>

                         

                                        <configuration>

                         

                                            <encoding>${project.build.sourceEncoding}</encoding>

                         

                                        </configuration>

                         

                                    </plugin>

                         

                                </plugins>

                         

                            </build>

                         

                            <repositories>

                         

                                <repository>

                         

                                    <id>JBoss-Releases</id>

                         

                                    <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>

                         

                                </repository>

                         

                            </repositories>

                         

                        </project>

                         

                        this is my json

                         

                        {

                         

                            "name" : "Persisted-Repository",

                         

                            "workspaces" : {

                         

                                "predefined" : ["otherWorkspace"],

                         

                                "default" : "default",

                         

                                "allowCreation" : true

                         

                            },

                         

                           

                         

                            "security" : {

                         

                                "anonymous" : {

                         

                                    "roles" : ["readonly","readwrite","admin"],

                         

                                    "useOnFailedLogin" : false

                         

                                }

                         

                            },

                         

                                "storage" : {

                         

                                "cacheConfiguration" : "infinispan_config.xml",

                         

                                "cacheName" : "persisted_repository",

                         

                                "binaryStorage" : {

                         

                                    "type" : "file",

                         

                                    "directory": "target/content/binaries",

                         

                                    "minimumBinarySizeInBytes" : 999

                         

                                }

                         

                            },

                         

                            

                         

                             "query":{

                         

                                "enabled":true,

                         

                                "rebuildUponStartup":"if_missing",

                         

                                "indexStorage": {

                         

                                    "type":"filesystem",

                         

                                    "location":"target/content/index",

                         

                                    "lockingStrategy":"simple",

                         

                                    "fileSystemAccessType":"auto"

                         

                                }

                         

                            },

                         

                        }

                         

                        this is my infispan.xml

                         

                        <?xml version="1.0" encoding="UTF-8"?>

                         

                          <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                         

                                     xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"

                         

                                     xmlns="urn:infinispan:config:5.1">

                         

                             <global>

                         

                             </global>

                         

                             <default>

                         

                             </default>

                         

                             <namedCache name="persisted_repository">

                         

                                 <loaders passivation="false" shared="false" preload="false">

                         

                                     <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore"

                         

                                             fetchPersistentState="false" ignoreModifications="false"

                         

                                             purgeOnStartup="false">

                         

                                       <properties>

                         

                                          <property name="stringsTableNamePrefix" value="ISPN_STRING_TABLE"/>

                         

                                          <property name="idColumnName" value="ID_COLUMN"/>

                         

                                          <property name="dataColumnName" value="DATA_COLUMN"/>

                         

                                          <property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>

                         

                                          <property name="timestampColumnType" value="BIGINT"/>

                         

                                          <property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>

                         

                                          <property name="connectionUrl" value="jdbc:sqlserver://localhost:1433;DatabaseName=modeshape"/>

                         

                                          <property name="userName" value="sa1"/>

                         

                                          <property name="password" value="sa"/>

                         

                                          <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

                         

                                          <property name="idColumnType" value="VARCHAR(255)"/>

                         

                                          <property name="dataColumnType" value="BINARY"/>

                         

                                          <property name="dropTableOnExit" value="false"/>

                         

                                          <property name="createTableOnStart" value="true"/>

                         

                                       </properties>

                         

                                    </loader>

                         

                                 </loaders>

                         

                                 <transaction

                         

                                     transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup"

                         

                                     transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC" />

                         

                            </namedCache>

                         

                        </infinispan>

                        • 9. Re: mode shape with sql server
                          Randall Hauch Master

                          Your POM file says:

                           

                          <modeshape.version>3.1.1.Final</modeshape.version>


                          Change this to be "3.7.2.Final", and try again. Then your configuration files (which are for 3.7.x and the proper version of Infinispan) will be read correctly.

                          • 11. Re: mode shape with sql server
                            Ant DASS LEYO Newbie

                            i'm moving slowly towards the result(i think so)

                             

                            i dont have errors (red messages) but nothing happens

                             

                            could you please tell me is there error

                             

                             

                             

                            15:49:11,487  INFO ModeShape version 3.1.1.Final

                            repository  . org.modeshape.jcr.JcrRepository@77f692f3

                            config Name . Persisted_Repository

                            the name repos : org.modeshape.jcr.JcrRepository@77f692f3

                            15:49:26,025  INFO ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL

                            15:49:26,705  INFO MLog clients using log4j logging.

                            15:49:26,871  INFO Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

                            15:49:27,356  INFO Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge0wz9116hr2b5m0n118|2625e90a, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.microsoft.sqlserver.jdbc.SQLServerDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge0wz9116hr2b5m0n118|2625e90a, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:sqlserver://localhost:1433;DatabaseName=modeshape, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

                             

                             

                             

                            as for me the program should create  a table

                             

                            name : ISPN_STRING_TABLE

                             

                             

                             

                            <properties>

                            <property name="stringsTableNamePrefix" value="ISPN_STRING_TABLE"/> -- this the name of the table in sql server

                             

                            <property name="idColumnName" value="ID_COLUMN"/>-- this corresponds to ?

                            <property name="dataColumnName" value="DATA_COLUMN"/>-- this correponds a node

                            <property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>-- this correponds a ?

                            <property name="timestampColumnType" value="BIGINT"/>-- this correponds type of node?

                             

                            <property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
                            <property name="connectionUrl" value="jdbc:sqlserver://localhost:1433;DatabaseName=modeshape"/>
                            <property name="userName" value="sa1"/>

                            <property name="password" value="sa"/>

                            <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

                            <property name="idColumnType" value="VARCHAR(255)"/>-- this correponds a ?

                            <property name="dataColumnType" value="BINARY"/>-- this correponds a ?

                            <property name="dropTableOnExit" value="false"/>-- this correponds a ?

                            <property name="createTableOnStart" value="true"/>-- this correponds a ?

                            </properties>

                             

                             

                            thanking you

                            • 12. Re: mode shape with sql server
                              Ant DASS LEYO Newbie

                              Thank you very much ;

                               

                              i have at last created a table with null values with some errors but i have a table

                               

                               

                               

                              17:29:04,499  INFO Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

                              17:29:04,624  INFO Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge0wz9116lb6q71ua2e7p|57697e2a, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.microsoft.sqlserver.jdbc.SQLServerDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge0wz9116lb6q71ua2e7p|57697e2a, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:sqlserver://localhost:1433;DatabaseName=modeshape, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

                              17:29:05,210 ERROR ISPN008024: Error while storing string key to database; key: 'repository:info', buffer size of value: 849 bytes

                              com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.

                               
                              • 13. Re: mode shape with sql server
                                Randall Hauch Master

                                Looks like you're still using an old version of ModeShape. It's also impossible to say what's going wrong without seeing the exact ModeShape and Infinispan configuration files you're using.

                                 

                                <properties>

                                <property name="stringsTableNamePrefix" value="ISPN_STRING_TABLE"/> -- this the name of the table in sql server

                                 

                                <property name="idColumnName" value="ID_COLUMN"/>-- this corresponds to ?

                                <property name="dataColumnName" value="DATA_COLUMN"/>-- this correponds a node

                                <property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>-- this correponds a ?

                                <property name="timestampColumnType" value="BIGINT"/>-- this correponds type of node?

                                 

                                <property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
                                <property name="connectionUrl" value="jdbc:sqlserver://localhost:1433;DatabaseName=modeshape"/>
                                <property name="userName" value="sa1"/>

                                <property name="password" value="sa"/>

                                <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

                                <property name="idColumnType" value="VARCHAR(255)"/>-- this correponds a ?

                                <property name="dataColumnType" value="BINARY"/>-- this correponds a ?

                                 

                                The "idColumnName" property contains the name of the column in which the node identifier is stored. The "idColumnType" property contains the database type that used to store the node identifier.

                                 

                                The "dataColumnName" property contains the name of the column in which the binary node representation is stored; the "dataColumnType" contains the database type of that column.

                                 

                                The "timestampColumnName" property contains the name of the column in which the timestamp that the row is updated; the "timestampColumnType" property contains the database type that used to store the timestamp.

                                 

                                <property name="dropTableOnExit" value="false"/>-- this correponds a ?

                                <property name="createTableOnStart" value="true"/>-- this correponds a ?

                                 

                                Infinispan can be used in many different ways, including as a purely "transient" (i.e., "short-lived") cache that doesn't live after being shutdown. If when that's the case, and ISPN is shutdown, some apps will want the database to be cleaned up.

                                 

                                However, for ModeShape you definitely want the "dropTableOnExit" to be "false", and "createTableOnStart" to be "true" if you want ModeShape/Infinispan to create the table for you, or "false" if you're going to create it manually.

                                 

                                BTW, this is all in the Infinispan documentation. Really, spend some time to read the documentation.

                                • 14. Re: mode shape with sql server
                                  Randall Hauch Master

                                  Ant DASS LEYO wrote:

                                   

                                  Thank you very much ;

                                   

                                  i have at last created a table with null values with some errors but i have a table

                                   

                                   

                                   

                                  17:29:04,499  INFO Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

                                  17:29:04,624  INFO Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge0wz9116lb6q71ua2e7p|57697e2a, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.microsoft.sqlserver.jdbc.SQLServerDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge0wz9116lb6q71ua2e7p|57697e2a, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:sqlserver://localhost:1433;DatabaseName=modeshape, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

                                  17:29:05,210 ERROR ISPN008024: Error while storing string key to database; key: 'repository:info', buffer size of value: 849 bytes

                                  com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.

                                   

                                  Then make your "idColumnType" longer than "varchar(255)".

                                  1 2 Previous Next