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 69C29DF6C for ; Fri, 14 Sep 2012 07:56:32 +0000 (UTC) Received: (qmail 65349 invoked by uid 500); 14 Sep 2012 07:56:31 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 65251 invoked by uid 500); 14 Sep 2012 07:56:31 -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 65217 invoked by uid 99); 14 Sep 2012 07:56:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2012 07:56:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jukka.zitting@gmail.com designates 209.85.220.170 as permitted sender) Received: from [209.85.220.170] (HELO mail-vc0-f170.google.com) (209.85.220.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2012 07:56:23 +0000 Received: by vcbfk26 with SMTP id fk26so9432595vcb.1 for ; Fri, 14 Sep 2012 00:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ErtJn0kMUopzs4yKSu2v52xRD0g61V5y/agCUXaoQjU=; b=IJYahk+4rvcgvlAnAFyotGOWj69GOZPq7u/i4yNx/65tJpLu3pPAxWETKOrC5WuFG5 eINDAKp++ltrndqxxTHw2RWP9Xgt/HR8y7kLaq6HDBHGfmUVQd4wtPUFwk7Ft2PF2yr8 jR2GAMSEM0P7EfQ+0D4pySeX94dEd/goH+QHYUpUBWfcjhUiR4IsW9WYE2IIwRDzy3pa dxyjcO+eyM6tyaHHKcb4kEyJcR92mOeywoO/YbyYGgLOrND4zCqsBkn3UNmIbaV9Noru ONFXTctyl7IhrOE7q0L+8H01OI9wQtVK0ARdJmLApQM3Y7alW/FFHaJjlv4Hnq1pyLJT Xdgg== Received: by 10.220.148.210 with SMTP id q18mr1381097vcv.6.1347609362166; Fri, 14 Sep 2012 00:56:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.91.194 with HTTP; Fri, 14 Sep 2012 00:55:41 -0700 (PDT) In-Reply-To: References: From: Jukka Zitting Date: Fri, 14 Sep 2012 09:55:41 +0200 Message-ID: Subject: Re: ContentSession.getCurrentRoot() is slow To: oak-dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, On Fri, Sep 14, 2012 at 7:32 AM, Thomas Mueller wrote: > 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. Yep, the javadocs should probably be improved for this. The rationale for not always returning the same root is to allow oak-jcr to implement directly persisted operations like workspace copies without having to acquire a separate ContentSession (and thus re-authenticate itself). > 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? A better alternative might be to move the getQueryEngine() method from ContentSession to Root. That way the returned QueryEngine instance can already contain an internal reference to the relevant Root. BR, Jukka Zitting