On 12 July 2012 15:47, Matthieu Rakotojaona
<[email protected]> wrote:
> Just a precision :
>
> On Thu, Jul 12, 2012 at 1:07 PM, Bernhard Gschwantner
> <[email protected]> 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.
>
> 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_Semantics_with_Bulk_Updates
>
> 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.
>
> --
> Matthieu RAKOTOJAONA

Matthieu,

Yes this is possible on a single instance but you can't guarantee
anything greater than a single document transaction as soon as you
subsequently use _changes, replication or views on top of that DB.

A+
Dave

Reply via email to