3 Replies Latest reply on Jun 8, 2012 8:08 AM by rhauch

    3.0.0.Alpha4 can't use QueryManager after restart JcrEngine

    neil.zou

      I have configured 3.0.0.4Aplha4 + infinispan 5.1.4Final + FileCacheStore.

       

      Now I can store data successfully, and can retrieve the correct data using below query

       

                  QueryManager queryManager = session.getWorkspace().getQueryManager();
                  
                  Query query =  null;
                  query = queryManager.createQuery("select * from [nt:base] where path() like '/%/" + "testfile.xml" + "/jcr:content'"
                          , Query.JCR_SQL2);
                  
                  QueryResult result = query.execute();
                  
                  NodeIterator nodeIterator = result.getNodes();
                  while (nodeIterator.hasNext()) {
                      Node node2 = nodeIterator.nextNode();
                      ......
                  }
      

       

      But after I restart the JcrEngine by using below code,

       

                  engine.shutdown().get();
                  engine.start();
                  repository = engine.deploy(config);
                  session = repository.login("default");
      

       

      Nothing could be search out anymore.

       

      But still can retrieve data using below way:

       

                  Node n = session.getNode("/meta/testfile.xml/jcr:content");
      

       

      Any issue with the QueryManager in this version?

        • 1. Re: 3.0.0.Alpha4 can't use QueryManager after restart JcrEngine
          rhauch

          It's likely more of an issue with ModeShape reusing the existing indexes. Check the "standalone-modeshape.xml" (or whatever configuration you're using) to see whether you're specifying where the indexes should be stored, and check that the location exists and has index files. The default location is '$JBOSS_HOME/standalone/data/modeshape/<repoName>/<repoName>/indexes/nodeinfo".

           

          If the files are there, and queries don't work upon startup, it's most likely a bug and should be logged as an issue.

          1 of 1 people found this helpful
          • 2. Re: 3.0.0.Alpha4 can't use QueryManager after restart JcrEngine
            neil.zou

            Oh... got, I forgot to configure the index storage location, so modeshape will store index in memory only.

            By the way, shall we have some warning if such important things are not configured?

            • 3. Re: 3.0.0.Alpha4 can't use QueryManager after restart JcrEngine
              rhauch

              Oh... got, I forgot to configure the index storage location, so modeshape will store index in memory only.

              By the way, shall we have some warning if such important things are not configured?

              Sorry about assuming that you were using AS7, too. If you're not, then absolutely the indexes default to in-memory.

               

              What to do in the default case is a bit tricky. Lemme start another thread on that topic.