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

BR,

Oren

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:
http://wiki.apache.org/couchdb/Replication_and_conflicts


Reply via email to