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 438CC7FBF for ; Thu, 1 Dec 2011 12:14:00 +0000 (UTC) Received: (qmail 13661 invoked by uid 500); 1 Dec 2011 12:14:00 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 13626 invoked by uid 500); 1 Dec 2011 12:14:00 -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 13619 invoked by uid 99); 1 Dec 2011 12:13:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 12:13:59 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.18.1.208] (HELO exprod6og107.obsmtp.com) (64.18.1.208) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 12:13:51 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob107.postini.com ([64.18.5.12]) with SMTP ID DSNKTtdvakgr6uoLphwwZov2h0zMUTabD1J3@postini.com; Thu, 01 Dec 2011 04:13:30 PST 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 pB1CBi8G004143 for ; Thu, 1 Dec 2011 04:11:44 -0800 (PST) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id pB1CDRRH021433 for ; Thu, 1 Dec 2011 04:13:28 -0800 (PST) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas03.corp.adobe.com (10.8.189.121) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 1 Dec 2011 04:13:27 -0800 Received: from susi.local (10.136.169.103) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.192.1; Thu, 1 Dec 2011 12:13:10 +0000 Message-ID: <4ED76F55.3030001@apache.org> Date: Thu, 1 Dec 2011 12:13:09 +0000 From: =?ISO-8859-1?Q?Michael_D=FCrig?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Subject: Re: [jr3 microkernel] Write skew References: <4ED63BEE.6010904@apache.org> <4ED751DC.8070606@apache.org> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 8bit On 1.12.11 12:05, Jukka Zitting wrote: > Hi, > > On Thu, Dec 1, 2011 at 11:07 AM, Michael D�rig wrote: >> Note however, that for the same reason we are currently not able to >> guarantee node type consistency: >> [...] >> Both sessions will successfully complete since for each of them the >> consistency property (nt:file cannot have a child named "foo"). holds. > > The save() implementation will need to do an internal refresh(true), > check any type and other constraints, and only persist the changes if > everything is OK. > > To prevent this from being a too big blocking operation, we can use > optimistic locking by making the last step of the process conditional > on the repository still being at the state it was when the > refresh(true) call was made. Otherwise the refresh-check-persist cycle > should be restarted. But this will introduce a race condition. With other words: this only make the time window during which such a inconsistency could slip in smaller. I think what we'd really need is an atomic test and set operation. Michael > > BR, > > Jukka Zitting