Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 97704 invoked from network); 20 Oct 2008 13:18:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Oct 2008 13:18:36 -0000 Received: (qmail 16245 invoked by uid 500); 20 Oct 2008 13:18:37 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 16220 invoked by uid 500); 20 Oct 2008 13:18:37 -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 16209 invoked by uid 99); 20 Oct 2008 13:18:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 06:18:37 -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; Mon, 20 Oct 2008 13:17:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 65D42234C21D for ; Mon, 20 Oct 2008 06:17:44 -0700 (PDT) Message-ID: <978568798.1224508664416.JavaMail.jira@brutus> Date: Mon, 20 Oct 2008 06:17:44 -0700 (PDT) From: "angela (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Resolved: (JCR-1821) jcr2spi: Item.isSame may return wrong result if any ancestor is invalidated In-Reply-To: <1126310228.1224494444359.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-1821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] angela resolved JCR-1821. ------------------------- Resolution: Fixed > jcr2spi: Item.isSame may return wrong result if any ancestor is invalidated > --------------------------------------------------------------------------- > > Key: JCR-1821 > URL: https://issues.apache.org/jira/browse/JCR-1821 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-jcr2spi > Reporter: angela > Assignee: angela > Fix For: 1.5.0 > > > julian detected an issue with jcr2spi that was previously shadowed due to heavy reloading of items upon save. > with the most recent changes however reloading of items is postponed until the next access. this will cause the following test to fail: > Node n = testRootNode.addNode("aFile", "nt:file"); > n = n.addNode("jcr:content", "nt:resource"); > n.setProperty("jcr:lastModified", Calendar.getInstance()); > n.setProperty("jcr:mimeType", "text/plain"); > Property jcrData = n.setProperty("jcr:data", "abc", PropertyType.BINARY); > testRootNode.save(); > // access same property through different session > Session otherSession = helper.getReadOnlySession(); > try { > Property otherProperty = (Property) otherSession.getItem(jcrData.getPath()); > assertTrue(jcrData.isSame(otherProperty)); > } finally { > otherSession.logout(); > } > while > > assertTrue(n.isSame(otherSession.getItem(n.getPath())); > would be successful. > the reason: the jcrData property is not reloaded and it's parent is still _invalidated_. consequently the property isn't aware of it's id having changed due to the fact that nt:resource is a node type extending from mix:referenceable. > possible fixes: > 1) mark all items _invalid_ after save > instead of setting status non-protected/autocreated properties to EXISTING. > -> forcing jcrData to be reloaded before isSame can be called. > -> drawback: much more round trip(s) to the server just to make sure the id is up to date. > 2) change Item#isSame to make sure the workspaceId is up to date (walking up the > hierarchy and force reloading of the first invalidated ancestor). > -> drawback: if referenceable nodes are rare or missing at all, this causes some > extra round trips. > > 3) change Item.isSame to compare the 'workspacePath' instead of the 'workspaceId'. > -> drawback: upon persisted move of a referenceable node Item#isSame will return false > after taking a closer look at the code and at some additional tests i would opt for 2). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.