Conflict in cbl

Hi
Why local update of a document in cbl get conflict ?
How do we get ahead of this?

You’ll get a conflict error saving a document if there’s already a newer revision of that document in the database. It means another writer was able to make and save a change before your code got a chance to.

The most common way this happens is if a pull replication is running, and downloads an updated revision of the document. But if your code makes changes from multiple threads, it’s possible that two threads could modify the same document and the one that tries to save second will get a conflict.

1 Like