From user-return-13777-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Nov 17 18:25:03 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 79987 invoked from network); 17 Nov 2010 18:25:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Nov 2010 18:25:03 -0000 Received: (qmail 19849 invoked by uid 500); 17 Nov 2010 18:25:33 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 19808 invoked by uid 500); 17 Nov 2010 18:25:33 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 19800 invoked by uid 99); 17 Nov 2010 18:25:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 18:25:32 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 18:25:26 +0000 Received: by iwn37 with SMTP id 37so2459779iwn.11 for ; Wed, 17 Nov 2010 10:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=JXHeHCflJ6q2EBm7jOr+2Cb6OF8Y+OaywFWAizbZjSw=; b=fNc+T4rggeQeeYm220ihUsc9ceZF49DU3Ad5t33LPwEXZjLrdVCHXerybSiHbS9l6B DbJv9xDelGcicdkg8C4i6mEdZNm6OmUyEYj9E/BI6S6ZE5CCILBujeeTdF5/RFXCqU+D XdYq2MK8X1KwO6XagoP/2ofholMt6QdPTEp9g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gib5S2D62ac0mjY6VtNxw7a8XzwHt0xlDbahfOj9KeM52hVR6EG1kI3FqoNUlmry5E j+OMEFfGKIDD6DPLyaZMot0B9W3e802bUSn4ffxoPiLqKf/S88Zd6XzgdffDpGYipCgX 4HBchQH2CerVfvWrm8L/OaIobcVGHoT2vIwA4= Received: by 10.231.37.197 with SMTP id y5mr7307592ibd.151.1290018303885; Wed, 17 Nov 2010 10:25:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.35.5 with HTTP; Wed, 17 Nov 2010 10:24:23 -0800 (PST) In-Reply-To: <4ce418b2.096ee60a.57dd.7e17@mx.google.com> References: <4ce418b2.096ee60a.57dd.7e17@mx.google.com> From: Paul Davis Date: Wed, 17 Nov 2010 13:24:23 -0500 Message-ID: Subject: Re: Write race conditions, working without _rev To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Nov 17, 2010 at 1:02 PM, rpkeane@gmail.com wrote: > > > Sent from my HTC on the Now Network from Sprint! > > ----- Reply message ----- > From: "Luciano Ramalho" > Date: Sat, Nov 6, 2010 15:52 > Subject: Write race conditions, working without _rev > To: > > On Fri, Nov 5, 2010 at 2:03 PM, Paul Davis wrote: >> In the second case, the second person to write the document wins, >> erasing any changes the first write's effects. The first writer will >> then be in a state where his view of the database will be >> inconsistent. The thing his, he can't know because without requiring a >> _rev token he'll never get a notification of any sort of error. > > As I understand, the situation you describe above never happens in > practice with CouchDB. A second PUT to the same document _id will > always require the _rev attribute, so there's no way to overwrite a > previous update by accident. This is one of the best features of > CouchDB for document-oriented persistency. > > > -- > Luciano Ramalho > programador repentista || stand-up programmer > Twitter: @luciano > That's true if you don't use _update handlers to hack around that part of CouchDB's design. Paul