Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 83981 invoked from network); 1 Jun 2007 14:42:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jun 2007 14:42:46 -0000 Received: (qmail 93399 invoked by uid 500); 1 Jun 2007 14:42:47 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 93384 invoked by uid 500); 1 Jun 2007 14:42:47 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 93355 invoked by uid 99); 1 Jun 2007 14:42:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 07:42:47 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of dominique.pfister@gmail.com designates 209.85.146.181 as permitted sender) Received: from [209.85.146.181] (HELO wa-out-1112.google.com) (209.85.146.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 07:42:42 -0700 Received: by wa-out-1112.google.com with SMTP id m38so708745waf for ; Fri, 01 Jun 2007 07:42:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=CncJWp3zam9a1st3jjApBZlx3zWUeRdjB9lV9TRMH50Fh2iH6WodV1TvraOfZu0DJHMtoempN5ZpuyMbbk67tmWlkr5pYHkXyAGXGKh72dnr+7lxLxcf9H+qs99yfoEmFOPnUGRdO6jMzyer6mQTJwoTYrcLPpxdTa26PAOsYNs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=HspY1sI0WpulUQv6KtCSA8P9omqI4M45VgsKCMU/juFdBYcynYTUlv9nQcpRoEpMbePBfi7hMxdcqMmZNAKAtHQRZ++fnFuPTkptqKCNNQImAUNDHWyKsVP7ibOfjIw7mxCspD8h5Rjctv0lNOpvTKSZaIJIkeyMH6ntc6+B4H4= Received: by 10.114.111.1 with SMTP id j1mr1894832wac.1180708942401; Fri, 01 Jun 2007 07:42:22 -0700 (PDT) Received: by 10.114.61.12 with HTTP; Fri, 1 Jun 2007 07:42:22 -0700 (PDT) Message-ID: <66c10f230706010742t250aa5fep89a36615670b4364@mail.gmail.com> Date: Fri, 1 Jun 2007 16:42:22 +0200 From: "Dominique Pfister" Sender: dominique.pfister@gmail.com To: users@jackrabbit.apache.org Subject: Re: XASession and hasPendingChanges In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <66c10f230706010617u52ab1e5fv156d158e3beecb3b@mail.gmail.com> X-Google-Sender-Auth: 0e0379bc156985a0 X-Virus-Checked: Checked by ClamAV on apache.org Well, the merge of two nodes will be part of the transaction, too. At the end of the transaction, all operations inside that transaction - whether or not related to versioning - will either be committed as an entity or rolled back. Kind regards Dominique On 6/1/07, Fr=E9d=E9ric Esnault wrote: > I agree on this, hasPendingChanges returning true in case of saved but un= committed > tx would create some difficulties, especially in a case like the one you = submitted. > > But...wouldn't it be dangerous to allow a merge of two nodes if one of th= em > is potentially modified by an uncommitted transaction? The merge can > succeed before tx commit, and fail after commit, which is a situation > hasPendingChanges not taking care of tx would allow. Am I wrong? > > Fr=E9d=E9ric Esnault - Ing=E9nieur R&D > Legisway > 60 boulevard de la mission Marchand > 92400 Courbevoie La D=E9fense > > > -----Message d'origine----- > De: dominique.pfister@gmail.com [mailto:dominique.pfister@gmail.com] De l= a part de Dominique Pfister > Envoy=E9: vendredi 1 juin 2007 15:17 > =C0: users@jackrabbit.apache.org > Objet: Re: XASession and hasPendingChanges > > Hi Fr=E9d=E9ric, > > according to the specification, hasPendingChanges should return true > if the session has unsaved changes. Some operations (e.g. > javax.jcr.Node.merge(String, boolean)) rely on a session not having > any pending changes. Some client could perfectly use code such as > > node.addNode("child"); > node.getSession().save(); > node.merge("sourcews", true); > > If an XASessionImpl has saved but uncommitted changes - this is > probably the case you're referring to, isn't it? - it could decide to > return true in its hasPendingChanges implementation. However, the same > client, unaware of the transactional nature of its session, would > never be able to execute the same piece of code shown above, because > the session would still report pending changes. In other words, a > client would have to detect whether or not it runs in a transactional > environment, which is probably not what you want. > > Kind regards > Dominique > > On 6/1/07, Fr=E9d=E9ric Esnault wrote: > > I have a question about the transactional version of the SessionImpl ob= ject. > > > > It inherits the hasPendingChanges from the SessionImpl class, but my qu= estion is : > > > > > > > > Shouldn't the hasPendingChanges from XASessionImpl take into considera= tion the tx status? > > > > Or am I missing something? > > > > > > > > Frederic Esnault > > > > >