Hi

We are working on a system that uses CBLite + CouchDB and are testing some 
offline capabilities. I was thinking that the sequence in which the 
documents are created in the mobile is the same sequence in which you will 
get it back when using the _changes feed. But that doesnt seem to happen. 
We are using CBLite Android 1.0.4.

Here is what happens:
1. Turned off the signal on the mobile 
2. Created a document (which was rev. 1020 below)
3. Created another document (which depends on the prev document) -- rev. 
1021 below
4. Go online
5. Figured out that record 1021 reached a custom script that we wrote that 
listens to the _changes feed before record 1020.

Database detail:
We have a dependent set of documents that get stored like this in the 
cblite database. (Taken from the revs table)

1020|452|1-3b3330898fc6ffe01715e7087903c1e8||0|0|{"createdByType":"5",
"order":0,"descriptionText":"Gg1","createdById":"1","shouldProcess":true,
"uuid":"3dab22c4-c0e4-4246-beb5-1688ebab8001","type":"Appliancegroups",
"deleted":false,"clientId":"124","createdondatetime":{"date":"2015-03-18 
18:00:23"}}|0

 

1021|453|1-1f41352bcd7f9a84df690fde1515684f||1|0|{"createdByType":"5",
"order":0,"descriptionText":"Tt1","createdById":"1","shouldProcess":true,
"uuid":"0c3a947b-b1b5-4209-b068-cec7ca5eac75","related_uuid":
"3dab22c4-c0e4-4246-beb5-1688ebab8001","type":"Appliancetypes","deleted":
false,"clientId":"124","createdondatetime":{"date":"2015-03-18 18:00:37"}}|0

 

1022|452|2-a102220e0e21e1ae2244d312e0b45faf|1020|1|0|{"id":30,
"createdByType":"5","createdbytype":5,"audit_deletedrecordid":null,"order":
30,"createdById":"1","descriptionText":"Gg1","uuid":
"3dab22c4-c0e4-4246-beb5-1688ebab8001","type":"Appliancegroups","deleted":0,
"createdondatetime":{"date":"2015-03-18 12:30:47.000000","timezone_type":3,
"timezone":"UTC"},"clientId":"124","createdbyid":1}|1



Im assuming that 1020 should have stored before 1021 in couchdb, but when 
doing a _changes feed, this is what I get (Ran curl -XGET 
http://username:password@localhost:5984/<db>/_changes?since=9156

......

{"seq":9179,"id":"fe26f303-46ff-462b-b915-317cd0aaa144","changes":[{"rev":"10-0cc7628c0add763a816095ab9c45b5cc"}]},

{"seq":9180,"id":"0c3a947b-b1b5-4209-b068-cec7ca5eac75","changes":[{"rev":"1-1f41352bcd7f9a84df690fde1515684f"}]},

{"seq":9182,"id":"3dab22c4-c0e4-4246-beb5-1688ebab8001","changes":[{"rev":"2-a102220e0e21e1ae2244d312e0b45faf"}]},

......

It looks like the document with uuid "0c3a947b-b1b5-4209-b068-cec7ca5eac75" 
which was revid: 1021 seems to have been sent before 
"3dab22c4-c0e4-4246-beb5-1688ebab8001" which is rev:1020 (and rev: 1022). 

Is that possible? I have a python script that listens on the _changes feed 
to do some backend operations (since our actual backend is PHP), so 
switching the order causes an issue since the records it depends on havent 
been received yet by the backend system.

Not sure if its related, but I get this when the PusherInternal was 
initializing:
03-18 18:00:55.771  17261-30037/com.commusoft.v2 E/RemoteRequest﹕ 
RemoteRequestCompletionBlock throw Exception



    java.lang.NullPointerException

            at com.couchbase.lite.replicator.PusherInternal$4.onCompletion(
PusherInternal.java:401)

            at com.couchbase.lite.support.RemoteRequestRetry$1.completed(
RemoteRequestRetry.java:178)

            at com.couchbase.lite.support.RemoteRequestRetry$1.onCompletion(
RemoteRequestRetry.java:189)

            at com.couchbase.lite.support.RemoteRequest.respondWithResult(
RemoteRequest.java:310)

            at com.couchbase.lite.support.RemoteRequest.executeRequest(
RemoteRequest.java:260)

            at com.couchbase.lite.support.RemoteRequest.run(RemoteRequest.
java:104)

            at java.util.concurrent.Executors$RunnableAdapter.call(Executors
.java:422)

            at java.util.concurrent.FutureTask.run(FutureTask.java:237)

            at java.util.concurrent.
ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(
ScheduledThreadPoolExecutor.java:152)

            at java.util.concurrent.
ScheduledThreadPoolExecutor$ScheduledFutureTask.run(
ScheduledThreadPoolExecutor.java:265)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1112)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:587)

            at java.lang.Thread.run(Thread.java:841)




I have been trying to verify this on CBLite-iOS but dont have a device at 
the moment, but will check as soon as I do. 

Regards

Raja


-- 
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/4c152a47-b37f-45eb-857b-5fe7592cf03c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to