2 Replies Latest reply on Feb 4, 2013 5:19 AM by hchiorean

    Cannot query anything after restart

    ozhou

      Hi Author,

       

      I configured the inifinispan's configuration to use MySQL. After the application restart, I cannot query anything, but if I get node by path, I can get the node.

       

      Here's my repository configuration:

       

      {
          "name" : "My Repository",
          "jndiName" : "",
          "workspaces" : {
              "predefined" : ["otherWorkspace"],
              "default" : "default",
              "allowCreation" : true
          },
          "storage" : {
              "cacheConfiguration" : "src/main/resources/infinispan-mysql.xml",
              "cacheName" : "databasePersistedRepository"
          },
          "security" : {
              "anonymous" : {
                  "roles" : ["readonly","readwrite","admin"],
                  "useOnFailedLogin" : false
              }
          },
          "node-types" : ["nodeTypes.cnd"]
      }
      
      

       

      The query is like this: SELECT * FROM [pd:product]

       

      Am I missing something in the configuration?

        • 1. Re: Cannot query anything after restart
          ozhou

          After calling ((org.modeshape.jcr.api.Workspace)session.getWorkspace()).reindex(), the query will succeed.

          It looks like rebuiltIndexOnStartup doesn't work, the default value for this configuration is "if_missing". But even I set it to "always", still no luck.

           

          Anyway, I fixed this issue by adding the following to the configuration file:

          "query" : {

                  "enabled" : true,

                  "indexStorage" : {

                      "type" : "filesystem",

                      "location" : "/Users/zhouyujie/index",

                      "lockingStrategy" : "native",

                      "fileSystemAccessType" : "auto"

                  }

              }

           

           

           


          • 2. Re: Cannot query anything after restart
            hchiorean

            Hi Oliver,

             

            I've opened https://issues.jboss.org/browse/MODE-1783 to investigate if/why the rebuild/always isn't working.