It's preventing you from clobbering a later revision that was added.  This
can happen if you have the following situation:

* Show user rev1 of document in UI
* Couchabse lite sync's rev2 of doc in background
* You try to save user's changes, based off rev1 (which is now stale)
* Couchbase Lite throws that error, since you passed in rev1 as the
previous revision, but rev1 is no longer the latest revision it knows about.

Does that sound like what's happening in your case?

If you debug it, you should see that you are trying to save a revision
based on a stale previous revision.  If not, it might be a bug in Couchbase
Lite worth looking into.




On Thu, Nov 6, 2014 at 5:24 PM, peng liu <[email protected]> wrote:

> Hi.I use couchbase on android.
> But some times when i  update my doc .it will crash.
> *11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr
> <http://com.eusoft.recite.fr> W/System.err﹕
> com.couchbase.lite.CouchbaseLiteException: Conflicts not allowed and there
> is already an existing doc with id: 4cd9f17d-f28f-48c9-8866-eec3a9cabe35*
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.couchbase.lite.Database.putRevision(Database.java:3480)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.couchbase.lite.Database.putRevision(Database.java:3415)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.couchbase.lite.Document.putProperties(Document.java:415)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.couchbase.lite.Document.putProperties(Document.java:250)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.eusoft.recite.support.entities.AbstractDocument.save(AbstractDocument.java:58)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.eusoft.recite.support.entities.AbstractDocument.save(AbstractDocument.java:44)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.eusoft.recite.support.ReciteSupportController.updateCardReviewInCouchBase(ReciteSupportController.java:417)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.eusoft.recite.support.ReciteSupportController.answerCard(ReciteSupportController.java:815)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> com.eusoft.recite.activity.recite.ReciteActivity$5.run(ReciteActivity.java:170)
> 11-07 09:19:51.440    9487-9562/com.eusoft.recite.fr W/System.err﹕ at
> java.lang.Thread.run(Thread.java:841)
>
> and how to fix it ?
> i found this issues:
> https://github.com/couchbase/couchbase-lite-java-core/issues/97#issuecomment-62040966
> but i have try to clean the document cache,it will crash again.
> * Database db = DBController.getInstance().getCouchDatabase();*
> *            if (db != null) {*
> *                try {*
> *                    entity.save(db);*
> *                } catch (CouchbaseLiteException e) {*
> *                    db.clearDocumentCache();*
> *                    entity.save(db);*
> *                }*
> *            }*
>
> --
> 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/a7cb8114-084d-4faa-b9cf-9191a7a7f3d8%40googlegroups.com
> <https://groups.google.com/d/msgid/mobile-couchbase/a7cb8114-084d-4faa-b9cf-9191a7a7f3d8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CACSSHCHVys1VGYdmvUpd0%2BucR__AAXHqpM7QRo6FwNntUDvTww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to