Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 45415 invoked from network); 6 Mar 2009 19:37:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Mar 2009 19:37:33 -0000 Received: (qmail 70858 invoked by uid 500); 6 Mar 2009 19:37:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 70826 invoked by uid 500); 6 Mar 2009 19:37:31 -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 70815 invoked by uid 99); 6 Mar 2009 19:37:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Mar 2009 11:37:31 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.217.162 as permitted sender) Received: from [209.85.217.162] (HELO mail-gx0-f162.google.com) (209.85.217.162) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Mar 2009 19:37:23 +0000 Received: by gxk6 with SMTP id 6so1128939gxk.11 for ; Fri, 06 Mar 2009 11:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=s34tGc/QsVvJYt0Awm6jhBBd+2JsZ5CSJt+7mpRhtc4=; b=IYry+8uo2Y7Mfc0cAeZ9ohwPXUJjbUoGvhN/SgdDHAUxlLvfq9HUPPL5ruSFGiYQ0L qWMl/QxzNPFn+vQx3R7/RYvs2yUyKRAzLnvUMOskpm7HhjPPaWMQ3TaJlUafS5QJNhSV tSSmtRgoz/UTAA6z5KxyqZrmVVO4GkN6KeFPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=weNVZbPRFgMGxpljJ17x+dqSrkSeNh6zWnHHfUoJAc0XgHqTr1AN/2nymK3H21p+E7 EdqyZqPxz4CaGZdAqP8lmDKT01glYCca7kxZi+c6auioTPeMF7ahfQ14O343YgqhXCoi JOgpzdSCwi5r43QaNa2GLsAWFAUqYIiTLftyY= MIME-Version: 1.0 Received: by 10.100.134.10 with SMTP id h10mr2083232and.28.1236368222254; Fri, 06 Mar 2009 11:37:02 -0800 (PST) In-Reply-To: <49B17241.4090209@muly.dk> References: <49B1543D.5060404@muly.dk> <64a10fff0903060854h62112eabu7c7f9f2784400d04@mail.gmail.com> <49B17241.4090209@muly.dk> Date: Fri, 6 Mar 2009 14:37:02 -0500 Message-ID: Subject: Re: put and no _rev From: Paul Davis To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Mar 6, 2009 at 1:58 PM, aju wrote: > hi dean > > thank you for the reply. > > Dean Landolt wrote: > >> *Exactly *like MVCC. That's what the revs are for. There's no diff >> mechanism >> in couch. > > well, i guess couch do store the deltas. > >> If you mean do the two requests make sense, then yes. Or better yet, you >> could just try to put, and if it fails, request the latest rev and give = it >> to your user to merge (or if you can do so algorithmically, then have at >> it). > > > what i hoped for was a solution with only one request for an action that > should just "overwrite" the last document. > > in a RDBMS when you update an existing row (document) it is a single step= . > (there's no revision term here obviously). likewise in subversion when yo= u > commit an updated document it is a single step. > Its a single step for the *user* in both cases. Both RDBMS's and Subversion are doing *alot* of behind the scenes voodoo to make sure that you're not overwriting a single doc simultaneous for consistency and transactional semantics. The issue is that when you try and make this magic span physical hosts it gets really hard. > > consider from the wiki docs: > > =A0GET /somedatabase/some_doc_id HTTP/1.0 > > =A0"The above example gets the current revision" > > > > then why would > > > =A0PUT /somedatabase/some_doc_id HTTP/1.0 > > > not also work on the current revision ? > > > ./allan > And Jan just wrote my example. Also for reference, the corresponding SQL is generally like such: UPDATE ... WHERE docid =3D ? AND revision_identifier =3D ? ; if num_affected_rows !=3D 1: raise ConflictError() HTH, Paul Davis