Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 24715 invoked from network); 9 Feb 2009 21:20:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 21:20:54 -0000 Received: (qmail 2771 invoked by uid 500); 9 Feb 2009 21:20:53 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 2491 invoked by uid 500); 9 Feb 2009 21:20:52 -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 2480 invoked by uid 99); 9 Feb 2009 21:20:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 13:20:52 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 209.85.221.21 as permitted sender) Received: from [209.85.221.21] (HELO mail-qy0-f21.google.com) (209.85.221.21) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 21:20:43 +0000 Received: by qyk14 with SMTP id 14so2946517qyk.11 for ; Mon, 09 Feb 2009 13:20:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=gWAEJpaHtdKMC1mT+TJF6KWz/MFFiJv4wE7O60rDHQ4=; b=kbpUXxPMIGJb1NCIfragavg5zTk5zm6zybYyLTudkibDQ9m3liqs7fKhkh5Z7icopV QyDoAwcb+NoDaygbFbIHyGDokJAnLD58um3MkxoltnLDHouEJyxshBDcdOKwdERFRmxe S+d+pDc73ZF0DAz4xOuk3uEGDvvWB21YycrOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=EeCsVH88bRqmObN77xmMQgZ+c140qxdFgzZ/jzJF+GCQc317eHUQogSIh6LYlRGSYt yBj5cKmAQWzzKrbjm8HBCIkv51gLSzDzUrphWnnHpKftG9O80rsb0g8SCfPzL9zD2k23 rtPQ1ecADWHNE5pRaD6bpTBPEuLy2Xzkp92Pw= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.214.78.4 with SMTP id a4mr7529169qab.118.1234214422877; Mon, 09 Feb 2009 13:20:22 -0800 (PST) In-Reply-To: <13ae4dd50902091313j699718a2jb676e958bc2de53d@mail.gmail.com> References: <13ae4dd50902091313j699718a2jb676e958bc2de53d@mail.gmail.com> Date: Mon, 9 Feb 2009 13:20:22 -0800 X-Google-Sender-Auth: 90bfe235e3a9bc23 Message-ID: Subject: Re: Multi doc transactions From: Chris Anderson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Feb 9, 2009 at 1:13 PM, Paul Carey wrote: > An extension to ii) to ensure consistency would be > 1. save the booking doc with a state property set to "incomplete" > 2. if the booking doc save succeeds, use the bulk update to save the > invites, and update the booking doc with state "complete". > > It's not very elegant, but I think it should work. I'd love to hear > better solutions. There's a lot of cool things you can do when you treat documents as state machines. Also, getting a view of "complete" bookings will be easy. Docs as state machines also works well in a multi-master environment, where you want to watch for "events" to be replicated to redundant storage. -- Chris Anderson http://jchris.mfdz.com