That code is reasonable, except in cases where another thread could be 
modifying the document. In that case the document might be updated by that 
thread after you access its properties and before you put the updated 
properties. The conflict error is to prevent your update from clobbering the 
one made by the other thread.

The most common situation where a background thread can update the document is 
if you’ve got a pull replication running, and the replicator (which is in the 
background) pulls a new revision of the document.

This does happen but since it’s a race condition it isn’t consistent, and in my 
experience it isn’t common. So I’m wondering why you consistently have this 
problem. Do you use multiple threads yourself?

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/54C8C90A-0900-4F8E-AE79-BB64CC8A1C73%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to