Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E7A8FD29C for ; Thu, 12 Jul 2012 14:48:32 +0000 (UTC) Received: (qmail 70354 invoked by uid 500); 12 Jul 2012 14:48:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 70156 invoked by uid 500); 12 Jul 2012 14:48: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 70134 invoked by uid 99); 12 Jul 2012 14:48:30 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 14:48:30 +0000 Received: from localhost (HELO [192.168.1.7]) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 14:48:30 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: Data modelling From: Robert Newson In-Reply-To: Date: Thu, 12 Jul 2012 15:48:28 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <54949139-6992-427A-86EA-4033D49E3648@apache.org> References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1278) It's not a transaction in any useful sense. B. On 12 Jul 2012, at 14:47, Matthieu Rakotojaona wrote: > Just a precision : >=20 > On Thu, Jul 12, 2012 at 1:07 PM, Bernhard Gschwantner > wrote: >> With that construction, you can be sure that it will never happen = that you >> deduct an amount from one account and never add it to the other. If = you >> make this two transaction documents, It could be that you try to = create >> both documents, but only one succeeds. Or if you replicate your = database, >> the first one is replicated, and then the network connection goes = down. >=20 > You can use the _bulk_docs endpoint with the all_or_nothing option, to > use some kind of transaction : > = http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API#Transactional_Semant= ics_with_Bulk_Updates >=20 > I know that replication uses the bulk API for putting the docs on the > target, but I don't know if it includes this option. >=20 > --=20 > Matthieu RAKOTOJAONA