jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r552544 - /jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
Date Mon, 02 Jul 2007 17:04:26 GMT
Author: jukka
Date: Mon Jul  2 10:04:24 2007
New Revision: 552544

URL: http://svn.apache.org/viewvc?view=rev&rev=552544
Log:
1.3: Merged revision 552445 (JCR-993)

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

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java?view=diff&rev=552544&r1=552543&r2=552544
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
Mon Jul  2 10:04:24 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