Is CouchDbInstance.replicate() asynchronous?

28 views
Skip to first unread message

Matt Martin

unread,
Oct 3, 2012, 11:09:18 PM10/3/12
to mobile-c...@googlegroups.com
Experiment:

1. I add a new document to my remote database. 
2. I launch a new "ReplicateService" that replicates from the remote server using dbInstance.replicate(myCommand).
3. The "ReplicateService" completes and reports back to a handler that there were no changes to the local database.
4. The UI loads and does not show the new document I added.
5. I comment out the line that launches the ReplicateService, recompile, and relaunch my app.
6. The UI loads without launching a ReplicateService (commented out).
7. I observe through the UI that the document I added to the remote database is now present on my Android device from the previous replication.

Is CouchDbInstance.replicate() asynchronous and if so, how do I wait for it to return?

Marty Schoch

unread,
Oct 4, 2012, 8:47:01 AM10/4/12
to mobile-c...@googlegroups.com
Yes, the replication commands are asynchronous. The official API
currently lacks any good way to monitor the progress. See this
thread:

https://groups.google.com/d/topic/mobile-couchbase/epp16Afu8NQ/discussion

for some ideas about how to work around it for now.

marty
> --
>
>
Reply all
Reply to author
Forward
0 new messages