4 Replies Latest reply on Dec 7, 2011 9:06 AM by Claudiu Muresan

    When deleting nodes from repository ...

    Claudiu Muresan Newbie



      We have a setup containing one JBoss 6.1 server instance (4GB max heap size) with ModeShape 2.6. The Modeshape JCR repository is persisted into an Oracle 11g db server (30 connections in the pool). When deleting a node from the repository it takes a whole lot of time to complete the operation although there are not so many nodes in the repository (check below the number of records).


      SQL> select count(*) from MODE_SIMPLE_NODE;



      SQL> select count(*) from MODE_SIMPLE_LARGE_VALUES;



      SQL> select count(*) from MODE_SUBGRAPH_NODES;



      SQL> select count(*) from MODESHAPE_LARGEVALUE_USAGES;



      From a thread dump I see that the JCR remove node operation is blocked at:


      Thread 25855: (state = BLOCKED)

      - sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information may be imprecise)

      - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=156 (Interpreted frame)

      - java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt() @bci=1, line=811 (Interpreted frame)

      - java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(int) @bci=68, line=941 (Interpreted frame)

      - java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(int) @bci=10, line=1261 (Compiled frame)

      - java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock() @bci=5, line=594 (Compiled frame)

      - org.modeshape.search.lucene.LuceneSearchEngine.createProcessor(org.modeshape.graph.ExecutionContext, org.modeshape.graph.search.AbstractSearchEngine$Workspaces, org.modeshape.graph.observe.Observer, boolean) @bci=30, line=237 (Interpreted frame)

      - org.modeshape.search.lucene.LuceneSearchEngine.createProcessor(org.modeshape.graph.ExecutionContext, org.modeshape.graph.search.AbstractSearchEngine$Workspaces, org.modeshape.graph.observe.Observer, boolean) @bci=6, line=73 (Interpreted frame)

      - org.modeshape.graph.search.AbstractSearchEngine.createProcessor(org.modeshape.graph.ExecutionContext, org.modeshape.graph.observe.Observer, boolean) @bci=8, line=169 (Interpreted frame)

      - org.modeshape.jcr.RepositoryQueryManager$SelfContained.query(java.lang.String, org.modeshape.graph.query.model.QueryCommand, org.modeshape.graph.query.validate.Schemata, org.modeshape.graph.query.plan.PlanHints, java.util.Map) @bci=24, line=431 (Interpreted frame)

      - org.modeshape.jcr.JcrQueryManager$SessionQueryContext.execute(org.modeshape.graph.query.model.QueryCommand, org.modeshape.graph.query.plan.PlanHints, java.util.Map) @bci=47, line=1422 (Interpreted frame)

      - org.modeshape.jcr.query.JcrQuery.execute() @bci=36, line=103 (Interpreted frame)

      - org.modeshape.jcr.JcrSession.recordRemoval(org.modeshape.graph.Location) @bci=213, line=1151 (Interpreted frame)

      - org.modeshape.jcr.JcrNode.doRemove() @bci=155, line=126 (Interpreted frame)

      - org.modeshape.jcr.AbstractJcrNode.removeShare() @bci=219, line=2415 (Interpreted frame)

      - org.modeshape.jcr.AbstractJcrNode.remove() @bci=1, line=2458 (Interpreted frame)

      - com.motive.kmp.dao.jcr.SubjectDAOImpl$7.execute(javax.jcr.Session, javax.jcr.Node) @bci=131, line=711 (Interpreted frame)

      - com.motive.kmp.dao.jcr.SubjectDAOImpl$7.execute(javax.jcr.Session, javax.jcr.Node) @bci=3, line=699 (Interpreted frame)

      - com.motive.kmp.dao.jcr.JcrDAOImpl.execute(com.motive.kmp.dao.jcr.JcrDAOImpl$JcrCommand) @bci=54, line=72 (Interpreted frame)

      - com.motive.kmp.dao.jcr.SubjectDAOImpl.deleteSubject(java.lang.String) @bci=10, line=699 (Interpreted frame)


      Could you give me some hints on what to check? Btw, when adding nodes in the repository it all goes fine.




        • 1. Re: When deleting nodes from repository ...
          Randall Hauch Master

          If you don't need referential integrity, turn that off on your repository (with the "performReferentialIntegrityChecks" repository option).


          If you do, I'd suggest turning up debug logging to find out what is causing that query to be blocked. This issue has been reported before, but we've never been able to replicate it or identify the cause.

          • 2. Re: When deleting nodes from repository ...
            Claudiu Muresan Newbie

            Hi Randall,


              Thanks for the tip.

               Can you check below if I made the correct changes to modeshape-config.xml?


            <mode:source jcr:name="store" mode:classname="org.modeshape.connector.store.jpa.JpaSource"














                                    mode:autoGenerateSchema="disable" />




            • 3. Re: When deleting nodes from repository ...
              Randall Hauch Master

              No, the "referentialIntegrityEnforced" is a repository option. Here is an example of a configuration file with several other repository options (though not "referentialIntegrityEnforced").

              • 4. Re: When deleting nodes from repository ...
                Claudiu Muresan Newbie



                Did the changes and performed the test, but it is still blocking on delete.

                You can check the thread dump from attachment.


                Below are the repository options from out modeshape-config.xml:


                <mode:options jcr:primaryType="options">

                                <!-- Should node types appear as nodes under '/jcr:system/jcr:nodeTypes'? -->

                                <mode:option jcr:name="projectNodeTypes" mode:value="true"/>

                                    <!-- The name of the JAAS application policy, used when clients get a session with credentials.

                                           (This policy is defined in the 'jboss-modeshape-beans.xml' file). -->

                                <mode:option jcr:name="jaasLoginConfigName" mode:value="modeshape"/>



                                                <!-- Explicitly specify the "system" workspace in the "SystemStore" source. -->

                                                <mode:option jcr:name="systemSourceName" mode:value="system@store"/>



                                                <!-- Explicitly specify the directory where the index files should be stored. -->

                                                <mode:option jcr:name="queryIndexDirectory" mode:value="${jboss.server.data.dir}/modeshape/repositories/store/indexes"/>


                                               <!--  Should  indexes should be rebuilt synchronously when the repository restarts, default true  -->

                                <mode:option jcr:name="queryIndexesRebuiltSynchronously" mode:value="true"/>

                                <!--  specifies the strategy (always or ifMissing) used to determine which query indexes need to be rebuilt when the repository restarts -->

                                <mode:option jcr:name="rebuildQueryIndexOnStartup" mode:value="ifMissing"/>

                                <mode:option jcr:name="performReferentialIntegrityChecks" mode:value="false"/>