Java sdk client cas help

@daschl thanks for response.

One Question:
Doc in couchbase:
{
flag: false
}

If two independent processes do following at the same time:

  1. doc = bucket.get(key)
  2. long cas = doc.cas()
  3. doc.flag=true
  4. bucket.replace(doc,cas)

Both are trying to set flag value to true.
Two process running on their own server.

As per your above comment. only one should be able to successed and second one will have cas miss match.