[exo-jcr-commits] exo-jcr SVN: r3302 - in jcr/branches/1.12.x/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/lock and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Oct 19 10:26:54 EDT 2010


Author: tolusha
Date: 2010-10-19 10:26:53 -0400 (Tue, 19 Oct 2010)
New Revision: 3302

Modified:
   jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java
   jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/lock/TestLock.java
Log:
JCR-1482: Fix issue when after restarting JCR doesn't retrieve all lock data from DB. After restarting server node will remain locked as expected.

Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java	2010-10-19 13:55:03 UTC (rev 3301)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java	2010-10-19 14:26:53 UTC (rev 3302)
@@ -140,14 +140,7 @@
     */
    public Set<?> getChildrenNames(Fqn fqn) throws Exception
    {
-      if (cache.getCacheStatus() == CacheStatus.STARTING)
-      {
-         // Try to get the list of children name from the nested cache loader
-         return cl.getChildrenNames(fqn);         
-      }
-      // All the data is loaded at startup, so no need to call the nested cache loader for another
-      // cache status other than CacheStatus.STARTING
-     return null;
+      return cl.getChildrenNames(fqn);
    }
 
    /**

Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/lock/TestLock.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/lock/TestLock.java	2010-10-19 13:55:03 UTC (rev 3301)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/lock/TestLock.java	2010-10-19 14:26:53 UTC (rev 3302)
@@ -42,6 +42,7 @@
 
    private Node lockedNode = null;
 
+   @Override
    public void setUp() throws Exception
    {
 
@@ -428,4 +429,26 @@
       assertFalse(childLockNode.isLocked());
 
    }
+
+   /**
+    * Test indicate if locked node after restarting still locked. 
+    */
+   public void testLockWithoutDBClean() throws Exception
+   {
+      String locNodeName = "TestLockNode";
+      if (session.getRootNode().hasNode(locNodeName))
+      {
+         Node node = session.getRootNode().getNode(locNodeName);
+         assertTrue(node.isLocked());
+      }
+      else
+      {
+         Node node = session.getRootNode().addNode(locNodeName);
+         node.addMixin("mix:lockable");
+         session.save();
+
+         node.lock(false, true);
+      }
+   }
+
 }



More information about the exo-jcr-commits mailing list