jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r552445 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
Date Mon, 02 Jul 2007 09:48:00 GMT
Author: dpfister
Date: Mon Jul  2 02:47:59 2007
New Revision: 552445

URL: http://svn.apache.org/viewvc?view=rev&rev=552445
Log:
JCR-993: corrupted paths after moving nodes

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java?view=diff&rev=552445&r1=552444&r2=552445
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
Mon Jul  2 02:47:59 2007
@@ -487,6 +487,24 @@
             if (idCache.get(id) != null) {
                 return;
             }
+
+            /**
+             * Do not cache paths to elements if the parent is transient, since
+             * children may be reordered multiple times (see JCR-993). If a
+             * child's position is cached at some intermediate stage but the
+             * total reordering effectively leaves the child at its initial
+             * position, the child's bad position is hardly detectable.
+             */
+            try {
+                NodeId parentId = state.getParentId();
+                if (parentId != null && provider.getItemState(parentId).isTransient())
{
+                    return;
+                }
+            } catch (ItemStateException e) {
+                String msg = "Unable to retrieve parent state of: " + id;
+                log.warn(msg, e);
+            }
+
             if (idCache.size() >= upperLimit) {
                 /**
                  * Remove least recently used item. Scans the LRU list from head to tail



Mime
View raw message