incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oren Shani <>
Subject Re: Resolving a classical conflict in CouchDB - Looking for best practices / advise
Date Sat, 28 May 2011 06:25:07 GMT
Thanks Owen,

I am trying to implement what you suggested which fits very well with my 
model. I have one question tough (to Oern or to anyone who may know) - 
how do I access the older revisions? Couch Potato does not seem to have 
a direct method for doing that, I asked in Upstream's website but I'd 
appreciate it if someone here can help too



On 05/20/2011 05:19 PM, Owen Marshall wrote:
> On 05/20/2011 09:46 AM, Oren Shani wrote:
>> The problem is that if I have to applications calling the function
>> concurrently, it might end up with a conflict, and then the document in
>> the database will have for example keyhash["abcd"] =5 /or
>> /keyhsah["efgh"] = 5 instead of keyhash["abcd"] = 5 /and/
>> keyhash["efgh"] = 6 (this is a rather classical concurrency conflict
>> problem so I suppose you understand what I mean...)
> GET your document with conflicts=true. If there are any conflicting
> revisions, GET those revisions as well. Then just merge together in a
> single document, write that correct document, and delete the conflicting
> revisions. I use a single POST to _bulk_docs for that part.
> See:

View raw message