Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 74569 invoked from network); 30 May 2008 10:24:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 May 2008 10:24:10 -0000 Received: (qmail 87950 invoked by uid 500); 30 May 2008 10:24:10 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 87921 invoked by uid 500); 30 May 2008 10:24:10 -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 87910 invoked by uid 99); 30 May 2008 10:24:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 03:24:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 10:23:23 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 17F5B234C130 for ; Fri, 30 May 2008 03:23:45 -0700 (PDT) Message-ID: <204429474.1212143025096.JavaMail.jira@brutus> Date: Fri, 30 May 2008 03:23:45 -0700 (PDT) From: "Frederic Laugier (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-1632) Mixin type loss In-Reply-To: <1107736961.1212141225052.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 [ https://issues.apache.org/jira/browse/JCR-1632?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Frederic Laugier updated JCR-1632: ---------------------------------- Attachment: patch_14 A patch to not store the PropertyState in the bundle for the 1.4 branch > Mixin type loss > --------------- > > Key: JCR-1632 > URL: https://issues.apache.org/jira/browse/JCR-1632 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-core > Affects Versions: 1.4, 1.5 > Environment: Linux 64-Bit (openSUSE 10.3) using Java 1.5.0_12 64-Bit > Reporter: Frederic Laugier > Attachments: asf-jackrabbit-tests_src.zip, patch_14 > > > When using a bundle persistence manager, the mixin type information may be corrupted in the lucene index, causing queries like '//element(*, my:mixin)' to fail. > The problem is that the 'jcr:mixinTypes' may be stored in the bundle. Here is how this could happen : > First step: Create a node and add a mixin 'A'. > Everything's fine. The query '//element(*, 'A')' works. > Second step : Select the node and add a second mixin 'B'. > When the second mixin is added, the AbstractBundlePersistenceManager#load(PropertyId) is called to get the current mixins for the node. This method will store the PropertyState for 'jcr:mixinTypes' in the bundle (containing only the mixin 'A'). Then the NodeImpl#setMixinTypesProperty() will set the PropertyState for 'jcr:mixinTypes' in the node state (containing the mixins 'A' and 'B'). > When the session is saved, the ChangeLog in AbstractBundlePersistenceManager#store() contains a modification for the 'jcr:mixinTypes' but it's being ignored, leaving the bundle with only mixin 'A'. The NodeIndexer looks into the node state to get the mixin types and indexes the node correctly. The queries '//element(*, 'A')' and '//element(*, 'B')' work. > Thrid step : Select the node and update a property. > When the session is saved, the NodeIndexer asks again for the 'jcr:mixinTypes' property, by calling the AbstractBundlePersistenceManager#load(PropertyId) to load it. The bundle contains this property and returns only mixin 'A' (as it was stored in the second step), causing the index to use only mixin 'A'. The query '//element(*, 'A')' still works but '//element(*, 'B') doesn't work anymore. > A simple solution to this would be to not store the PropertyState for the 'jcr:mixinTypes' (and 'jcr:uuid' and 'jcr:primaryType', as the class description states) in the bundle when the PropertyState is loaded. It would fix the issue but not the contents on existing repositories. One way to allow the repositories to fix themselves is to not read or write these 3 properties in the BundleBinding#readBundle and BundleBinding#writeBundle methods, but I'm not sure wether or not it would have a performance impact. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.