Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9E71108D1 for ; Thu, 25 Jul 2013 08:10:13 +0000 (UTC) Received: (qmail 34514 invoked by uid 500); 25 Jul 2013 08:10:13 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 34220 invoked by uid 500); 25 Jul 2013 08:10:12 -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 34213 invoked by uid 99); 25 Jul 2013 08:10:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 08:10:11 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anchela@adobe.com designates 64.18.1.77 as permitted sender) Received: from [64.18.1.77] (HELO exprod6og126.obsmtp.com) (64.18.1.77) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 08:10:06 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob126.postini.com ([64.18.5.12]) with SMTP ID DSNKUfDdSfIIf+CfGXH9PY714vKx1MTgKtyH@postini.com; Thu, 25 Jul 2013 01:09:45 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r6P86JD8023862 for ; Thu, 25 Jul 2013 01:06:19 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r6P89j6A010696 for ; Thu, 25 Jul 2013 01:09:45 -0700 (PDT) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.298.1; Thu, 25 Jul 2013 01:09:44 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurcas01.eur.adobe.com ([10.128.4.27]) with mapi; Thu, 25 Jul 2013 09:09:41 +0100 From: Angela Schreiber To: "dev@jackrabbit.apache.org" Date: Thu, 25 Jul 2013 09:09:40 +0100 Subject: Re: [jcr2spi] RepositoryException lost in ItemManager#nodeExists Thread-Topic: [jcr2spi] RepositoryException lost in ItemManager#nodeExists Thread-Index: Ac6JDk/8VlogfOrFTUSzkLC8nvT+ZQ== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.2.130206 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org hi chetan the ItemManager is an internal interface which can be changed. but i really don't want you to change the behavior and throw a runtime exception without a very detailed analysis of the impact. kind regards angela On 7/25/13 9:54 AM, "Chetan Mehrotra" wrote: >Also looking at org.apache.jackrabbit.jcr2spi.ItemManager [1] the >method signature for nodeExists, itemExists and propertyExists should >have thrown RepositoryException just like other methods of the >interface. But that not the case :( And changing that now is not an >option > >So best way to move forward would be to wrap it in RuntimeException > >[1]=20 >https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-jcr2spi/src/mai >n/java/org/apache/jackrabbit/jcr2spi/ItemManager.java > >Chetan Mehrotra > > >On Thu, Jul 25, 2013 at 1:16 PM, Chetan Mehrotra > wrote: >> Hi Angela, >> >> But then returning false gives a wrong indication to the caller that >> node/item does not exist and then it would cause issues in the >> business logic implemented on top of that. So exception has to be >> propagated upward. Now as method signature does not have the >> RepositoryException then probably have to wrap it in some >> RuntimeException. >> >> Chetan Mehrotra >> >> >> On Thu, Jul 25, 2013 at 1:09 PM, Angela Schreiber >>wrote: >>> hi chetan >>> >>> i wouldn't do that as we generally avoid runtimeexceptions in >>>jackrabbit. >>> instead i would log an error. >>> >>> >>> angela >>> >>> On 7/24/13 3:01 PM, "Chetan Mehrotra" >>>wrote: >>> >>>>Looking at the code [1] >>>> >>>> /** >>>> * @see ItemManager#nodeExists(Path) >>>> */ >>>> public boolean nodeExists(Path path) { >>>> try { >>>> // session-sanity & permissions are checked upon >>>>itemExists(ItemState) >>>> NodeState nodeState =3D hierMgr.getNodeState(path); >>>> return itemExists(nodeState); >>>> } catch (PathNotFoundException pnfe) { >>>> return false; >>>> } catch (ItemNotFoundException infe) { >>>> return false; >>>> } catch (RepositoryException re) { >>>> return false; >>>> } >>>> } >>>> >>>>The catch block for RepositoryException should probably wrap the >>>>exception as a RuntimeException as it might happen for unknown reason. >>>>Changing this might break backward compatibility. Would it be fine to >>>>do that? >>>> >>>>@abhinav - Can you open a bug for this? >>>> >>>>[1] >>>>https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-jcr2spi/src/ >>>>mai >>>>n/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java#L115 >>>>Chetan Mehrotra >>>> >>>> >>>>On Tue, Jul 23, 2013 at 7:42 PM, Abhinav Atul wrote: >>>>> Just in case if this would be the right place to find a solution. >>>>>Please let me know if anything is unclear. >>>>> >>>>> Thanks >>>>> Abhinav >>>>> >>>>> -----Original Message----- >>>>> From: Abhinav Atul [mailto:aatul@adobe.com] >>>>> Sent: 22 July 2013 14:58 >>>>> To: Jackrabbit Users >>>>> Subject: [jcr2spi] RepositoryException lost in ItemManager#nodeExists >>>>> >>>>> Hi, >>>>> I am trying to implement a synchronization service >>>>>using the jcr connector for Documentum. The issue I am facing is if >>>>>the >>>>>Documentum server becomes non-responsive while trying to check if a >>>>>node >>>>>has been updated or deleted at Documentum, the RepositoryException is >>>>>lost in ItemManagerImpl#nodeExists and the synchronization service is >>>>>communicated that the node does not exists which may not be the case. >>>>>Could the RepositoryException be communicated further? >>>>> >>>>> Thanks >>>>> Abhinav >>>>> >>>