Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 7030 invoked from network); 18 Dec 2006 15:49:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Dec 2006 15:49:45 -0000 Received: (qmail 86952 invoked by uid 500); 18 Dec 2006 15:49:51 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 86918 invoked by uid 500); 18 Dec 2006 15:49:51 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 86909 invoked by uid 99); 18 Dec 2006 15:49:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2006 07:49:51 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2006 07:49:43 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1F4BF714293 for ; Mon, 18 Dec 2006 07:49:23 -0800 (PST) Message-ID: <8744772.1166456963125.JavaMail.jira@brutus> Date: Mon, 18 Dec 2006 07:49:23 -0800 (PST) From: "Dominique Pfister (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-682) AccessManager + CachingHierarchyManager problem In-Reply-To: <23064308.1166450841044.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/JCR-682?page=comments#action_12459386 ] Dominique Pfister commented on JCR-682: --------------------------------------- Thanks to your test case, I could easily reproduce the issue: it happens when transient items are reordered. The CachingHierarchyManager uses the method NodeState.getReorderedChildNodeEntries() to retrieve the set of reordered items, but this returns only changes between some state and its overlayed (i.e. persistent) state. Your test case performs the following operations in pseudo code: - addNode -> N1 - addNode -> N2 - addNode -> N3 - orderBefore(N3, N2) which leaves the CachingHierarchyManager with an empty reordered list since the nodes have not yet been persisted. The CachingHierarchyManager should better evict its associated cache entry, if it detects a purely transient reorder. > AccessManager + CachingHierarchyManager problem > ----------------------------------------------- > > Key: JCR-682 > URL: http://issues.apache.org/jira/browse/JCR-682 > Project: Jackrabbit > Issue Type: Bug > Components: core > Affects Versions: 1.1.1 > Reporter: Roland Kofler > Attachments: CachingHierarchManagerTest.zip > > > The problem we have is the implementation of the CachingHierarchyManager, > to which the SimpleAccessManager holds a reference. > Let's consider following example: > i add 3 subnodes (a,b,c) to a node and after that i reorder b and c .. > so i have a,c,b. in the process of reordering (using the function > orderBefore of javax.jcr.Node) our AccessManager is called several times to check the permissions of the nodes. In this AccessManager we use some > functions of the CachingHierarchyManager, f.ex. > Path itemPath = hierMgr.getPath(id); > return itemPath.denotesRoot(); > or > Path itemPath = hierMgr.getPath(itemId); > Path parentPath = itemPath.getAncestor(1); > return hierMgr.resolvePath(parentPath); > the problem is, that when calling the methods of the > CachingHierarchyManager the nodes i ask for will be cached in the idCache in a wrong state (i. e.: before actually reordering the elements). > so if i want f.ex. delete the node b after reordering, the node will > be looked up in the idCache. in the cache the index of node b is still 2 > (actually it should be 3) and so the wrong node will be deleted! -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira