Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4AB1DDF31 for ; Fri, 14 Sep 2012 07:48:43 +0000 (UTC) Received: (qmail 45655 invoked by uid 500); 14 Sep 2012 07:48:43 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 45608 invoked by uid 500); 14 Sep 2012 07:48:42 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 45600 invoked by uid 99); 14 Sep 2012 07:48:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2012 07:48:42 +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 (nike.apache.org: domain of mueller@adobe.com designates 64.18.1.35 as permitted sender) Received: from [64.18.1.35] (HELO exprod6og115.obsmtp.com) (64.18.1.35) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2012 07:48:32 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob115.postini.com ([64.18.5.12]) with SMTP ID DSNKUFLhO9Z7OyVCMMovhgAdd5vnjbCNrudX@postini.com; Fri, 14 Sep 2012 00:48:12 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q8E7jY5I001753 for ; Fri, 14 Sep 2012 00:45:35 -0700 (PDT) Received: from nacas02.corp.adobe.com (nacas02.corp.adobe.com [10.8.189.100]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q8E7m8Sk020018 for ; Fri, 14 Sep 2012 00:48:09 -0700 (PDT) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nacas02.corp.adobe.com (10.8.189.100) with Microsoft SMTP Server (TLS) id 8.3.264.0; Fri, 14 Sep 2012 00:48:08 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurcas01.eur.adobe.com ([10.128.4.27]) with mapi; Fri, 14 Sep 2012 08:48:06 +0100 From: Thomas Mueller To: "oak-dev@jackrabbit.apache.org" Date: Fri, 14 Sep 2012 08:47:58 +0100 Subject: Re: ContentSession.getCurrentRoot() is slow Thread-Topic: ContentSession.getCurrentRoot() is slow Thread-Index: Ac2STUb4YdJ+h5aYTVSFYpLBgJlFDg== 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.2.3.120616 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Hi, What about renaming ContentSession.getCurrentRoot() to getHeadRoot() or getCurrentHeadRoot()? About workspaces - I know we said we don't support workspaces currently, but there still is ContentSession.getWorkspaceName(). Could we remove this method for now? The problem is that it's not clear whether getCurrentRoot(), and the Root class, is for the / a workspace or for the complete repository. About the class Root: is the data returned by this class filtered for the ContentSessions access rights? I can't find that info in the Javadocs. If it is, maybe we could (later on) combine Root and ContentSession. But for now I guess it's enough to add a comment in the Javadoc. Regards, Thomas On 9/14/12 7:32 AM, "Thomas Mueller" wrote: >Hi, > >>It would be better if the query engine used the same tree snapshot as >>the rest of the session. There shouldn't be any need to call >>getCurrentRoot(). > >This is actually what I expected that ContentSession.getCurrentRoot() >would provide me: I expected getCurrentRoot() would always return the same >root until the session has committed or refreshed. It wasn't obvious to me >neither from the method name nor from the javadocs that there is >(potentially) a new current root every time the method is called. Not a >problem, I can change the javadocs and add that info. > >But now I see that the ContentSession doesn't in fact know the current >revision and doesn't provide snapshot isolation, how do I use the same >tree snapshot as the rest of the session? Is it the oak-jcr >SessionDelegate.root field? I guess I will have to change the oak-core >query API then, and add the Root as a parameter to the method >SessionQueryEngine.executeQuery? > >Regards, >Thomas >