Update conflicts are still possible when using update handlers.
Due to the reduced "round-trip time," the chance of an update conflict is lower but not zero. A conflict will feel normal: a 409 response code with this JSON:
{"error":"conflict","reason":"Document update conflict."}
I successfully triggered a conflict using the document update handler example, and running curl twice in short succession in the shell.
curl -v -X PUT \
http://localhost:5984/db/_design/app/_update/accumulate/my_doc?amount=10 \
& curl -X PUT \
http://localhost:5984/db/_design/app/_update/accumulate/my_doc?amount=1
One of the curl responses (randomly) was a 201 and the other a 409.
Document update handlers do not fundamentally change CouchDB
Updates are subject to conflicts, as well as validation failures (401 Unauthorized
,
403 Forbidden
, etc.)
jhs
2010-06-06 07:53:38