Exception in TDRouter after calling application is destroyed (Android-TouchDb)

76 views
Skip to first unread message

scott coleman

unread,
Jun 18, 2012, 6:23:47 PM6/18/12
to mobile-c...@googlegroups.com
I have an application which is syncing records to our server database. This is working. The problem is when the app is exited I get a "Exception in TDRouter".

06-18 15:12:32.457: V/TDDatabase(27853): TDPuller [http://bob1.t2.local:5984/db-sync1]: Setting lastSequence to 13 from( 1)
06-18 15:12:32.457: V/TDDatabase(27853): *** com.couchbase.touchdb.replicator.TDReplicator$1@417e7fc8: END processInbox (lastSequence=13
06-18 15:12:32.457: V/TDDatabase(27853): com.couchbase.touchdb.support.TDRemoteRequest@425da6c8: PUT .http://bob1.t2.local:5984/db-sync1/_local/f2c42f0bbfce86242c71d8d88665952e0bc5af31
06-18 15:12:32.746: D/BFDemo(27853): {TS:1340057552729,IBI:1996,SDNN:0.00,},
06-18 15:12:33.667: I/BFDemo(27853): onPause
06-18 15:12:33.675: V/TDDatabase(27853): TDPusher [http://bob1.t2.local:5984/db-sync1] STOPPING...
06-18 15:12:33.675: D/TDDatabase(27853): in stopped
06-18 15:12:33.683: V/TDDatabase(27853): Chagne tracker run loop exiting
06-18 15:12:33.683: V/TDDatabase(27853): TDPuller [http://bob1.t2.local:5984/db-sync1] STOPPED
06-18 15:12:34.175: I/BFDemo(27853): surfaceDestroyed
06-18 15:12:34.308: D/dalvikvm(27853): GC_CONCURRENT freed 2109K, 8% free 26551K/28743K, paused 7ms+3ms
06-18 15:12:34.777: I/BFDemo(27853): onDestroy
06-18 15:12:34.917: V/TDDatabase(27853): com.couchbase.touchdb.replicator.TDPusher$2$1@417d5970: Sent [{1340057538304-06c61af5-1f57-449c-91ec-ca17d04c0403 #1-0b424dc4-aabd-4c2b-927f-a309726ea47b}, {1340057542626-b7579b84-549d-4351-a4b3-3c0146dfce04 #1-833eb7b2-f714-4b3a-9d61-8dd7272e3238}, {1340057540554-a3c98058-7d05-48a6-be03-c23ee5cd9253 #1-849c6071-8a82-43e5-8db6-8a90cb60b3b1}]
06-18 15:12:34.925: V/TDDatabase(27853): TDPusher [http://bob1.t2.local:5984/db-sync1]: Setting lastSequence to 100 from( 97)
06-18 15:12:34.933: V/TDDatabase(27853): TDPusher [http://bob1.t2.local:5984/db-sync1] STOPPED
06-18 15:12:35.082: D/BFDemo(27853): Document created successfully
06-18 15:12:35.082: D/BFDemo(27853): Document created successfully
06-18 15:12:35.089: E/TDDatabase(27853): Exception in TDRouter
06-18 15:12:35.089: E/TDDatabase(27853): java.lang.reflect.InvocationTargetException
06-18 15:12:35.089: E/TDDatabase(27853): at java.lang.reflect.Method.invokeNative(Native Method)
06-18 15:12:35.089: E/TDDatabase(27853): at java.lang.reflect.Method.invoke(Method.java:511)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-18 15:12:35.089: E/TDDatabase(27853): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-18 15:12:35.089: E/TDDatabase(27853): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-18 15:12:35.089: E/TDDatabase(27853): at org.t2health.lib1.DataOutHandler$5.doInBackground(DataOutHandler.java:427)
06-18 15:12:35.089: E/TDDatabase(27853): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-18 15:12:35.089: E/TDDatabase(27853): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-18 15:12:35.089: E/TDDatabase(27853): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-18 15:12:35.089: E/TDDatabase(27853): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-18 15:12:35.089: E/TDDatabase(27853): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-18 15:12:35.089: E/TDDatabase(27853): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-18 15:12:35.089: E/TDDatabase(27853): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-18 15:12:35.089: E/TDDatabase(27853): at java.lang.Thread.run(Thread.java:856)
06-18 15:12:35.089: E/TDDatabase(27853): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-18 15:12:35.089: E/TDDatabase(27853): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-18 15:12:35.089: E/TDDatabase(27853): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-18 15:12:35.089: E/TDDatabase(27853): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-18 15:12:35.089: E/TDDatabase(27853): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)

Marty Schoch

unread,
Jun 18, 2012, 6:31:41 PM6/18/12
to mobile-c...@googlegroups.com
Do you create documents in your onDestroy() method?

I see the lines:

> 06-18 15:12:35.082: D/BFDemo(27853): Document created successfully
> 06-18 15:12:35.082: D/BFDemo(27853): Document created successfully

After seeing:

> 06-18 15:12:34.777: I/BFDemo(27853): onDestroy

And possibly the exception is when it tries to create a 3rd document.
But the server is already shutdown. Is it possible you have other
writes going on in the background at the time you try to exit?

marty

scott coleman

unread,
Jun 19, 2012, 1:22:08 PM6/19/12
to mobile-c...@googlegroups.com
So this is interesting. I re-ran my application, reducing the number of database writes.
I log "Beat Detected" when I add a new item to the database (couchDbConnector.create).

All of the logging calls are before my application is destroyed (at destruction I call httpClient.shutdown(), and server.close()), but all of the "Document created successfully" messages - and the exceptions are after.
06-19 09:38:52.493: E/BFDemo(8313): Beat Detected
06-19 09:38:53.243: E/BFDemo(8313): Beat Detected
06-19 09:38:54.095: E/BFDemo(8313): Beat Detected
06-19 09:38:54.853: E/BFDemo(8313): Beat Detected
06-19 09:38:55.579: E/BFDemo(8313): Beat Detected
06-19 09:38:56.571: E/BFDemo(8313): Beat Detected
06-19 09:38:57.462: E/BFDemo(8313): Beat Detected
06-19 09:38:58.165: E/BFDemo(8313): Beat Detected
06-19 09:38:59.064: E/BFDemo(8313): Beat Detected
06-19 09:39:00.618: E/BFDemo(8313): Beat Detected
06-19 09:39:01.493: E/BFDemo(8313): Beat Detected
06-19 09:39:02.212: E/BFDemo(8313): Beat Detected
06-19 09:39:03.189: E/BFDemo(8313): Beat Detected
06-19 09:39:03.790: E/BFDemo(8313): Beat Detected
06-19 09:39:04.689: E/BFDemo(8313): Beat Detected

06-19 09:39:05.985: I/BFDemo(8313): surfaceDestroyed
06-19 09:39:06.540: I/BFDemo(8313): onDestroy

06-19 09:39:09.610: D/BFDemo(8313): Document created successfully 
06-19 09:39:09.634: D/BFDemo(8313): Document created successfully
06-19 09:39:10.767: D/BFDemo(8313): Document created successfully
06-19 09:39:15.720: D/BFDemo(8313): Document created successfully
06-19 09:39:16.696: D/BFDemo(8313): Document created successfully
06-19 09:39:17.149: D/BFDemo(8313): Document created successfully
06-19 09:39:17.478: D/BFDemo(8313): Document created successfully
06-19 09:39:17.548: D/BFDemo(8313): Document created successfully
06-19 09:39:17.829: D/BFDemo(8313): Document created successfully
06-19 09:39:17.946: D/BFDemo(8313): Document created successfully
06-19 09:39:17.993: D/BFDemo(8313): Document created successfully
06-19 09:39:17.993: D/BFDemo(8313): Document created successfully
06-19 09:39:18.032: D/BFDemo(8313): Document created successfully

Here's the whole log:

06-19 09:39:02.212: E/BFDemo(8313): Beat Detected
06-19 09:39:02.235: D/BFDemo(8313): {TS:1340123942218,IBI:715,SDNN:44.04,},
06-19 09:39:02.876: V/TDDatabase(8313): about to notify client
06-19 09:39:02.876: V/TDDatabase(8313): Starting new longpoll
06-19 09:39:02.876: V/TDDatabase(8313): TDPuller [http://bob1.t2.local:5984/grocery-sync1]: Received #1 {1340123924652-e5dc7d4b-291d-4710-aa91-89a2b0719d88 #1-7b7771db-e0d1-422a-9199-1282b4175446}
06-19 09:39:02.884: V/TDDatabase(8313): about to notify client
06-19 09:39:02.884: V/TDDatabase(8313): TDPuller [http://bob1.t2.local:5984/grocery-sync1]: Received #2 {1340123925838-261b284e-db1e-42eb-98d2-a5a96bc2a280 #1-c9b32417-d4f7-4772-84f2-d435426ad5fd}
06-19 09:39:02.892: V/TDDatabase(8313): about to notify client
06-19 09:39:02.892: V/TDDatabase(8313): TDPuller [http://bob1.t2.local:5984/grocery-sync1]: Received #3 {1340123926697-a831a5e0-37b8-426c-9f70-ed674f7f7abb #1-5ecb86ec-2f6c-451d-8293-cbb3bcdfc0c1}
06-19 09:39:02.923: V/TDDatabase(8313): Making request to http://bob1.t2.local:5984/grocery-sync1/_changes?feed=longpoll&heartbeat=300000&since=3
06-19 09:39:02.954: V/TDDatabase(8313): com.couchbase.touchdb.replicator.TDPusher$2$1@4172cca8: Sent [{1340123924652-e5dc7d4b-291d-4710-aa91-89a2b0719d88 #1-7b7771db-e0d1-422a-9199-1282b4175446}, {1340123925838-261b284e-db1e-42eb-98d2-a5a96bc2a280 #1-c9b32417-d4f7-4772-84f2-d435426ad5fd}, {1340123926697-a831a5e0-37b8-426c-9f70-ed674f7f7abb #1-5ecb86ec-2f6c-451d-8293-cbb3bcdfc0c1}]
06-19 09:39:02.962: V/TDDatabase(8313): TDPusher [http://bob1.t2.local:5984/grocery-sync1]: Setting lastSequence to 174 from( null)
06-19 09:39:03.134: D/dalvikvm(8313): GC_CONCURRENT freed 1855K, 7% free 27301K/29255K, paused 3ms+4ms
06-19 09:39:03.189: E/BFDemo(8313): Beat Detected
06-19 09:39:03.220: D/BFDemo(8313): {TS:1340123943194,IBI:978,SDNN:47.12,},
06-19 09:39:03.790: E/BFDemo(8313): Beat Detected
06-19 09:39:03.814: D/BFDemo(8313): {TS:1340123943800,IBI:608,SDNN:56.30,},
06-19 09:39:04.689: E/BFDemo(8313): Beat Detected
06-19 09:39:04.704: D/BFDemo(8313): {TS:1340123944695,IBI:895,SDNN:56.65,},
06-19 09:39:04.884: V/TDDatabase(8313): *** com.couchbase.touchdb.replicator.TDReplicator$1@417f8ec8: BEGIN processInbox (3 sequences)
06-19 09:39:04.884: W/TDDatabase(8313): TDPuller [http://bob1.t2.local:5984/grocery-sync1]: Looking up [{1340123924652-e5dc7d4b-291d-4710-aa91-89a2b0719d88 #1-7b7771db-e0d1-422a-9199-1282b4175446}, {1340123925838-261b284e-db1e-42eb-98d2-a5a96bc2a280 #1-c9b32417-d4f7-4772-84f2-d435426ad5fd}, {1340123926697-a831a5e0-37b8-426c-9f70-ed674f7f7abb #1-5ecb86ec-2f6c-451d-8293-cbb3bcdfc0c1}]
06-19 09:39:04.899: W/TDDatabase(8313): TDPuller [http://bob1.t2.local:5984/grocery-sync1] no new remote revisions to fetch
06-19 09:39:04.907: V/TDDatabase(8313): TDPuller [http://bob1.t2.local:5984/grocery-sync1]: Setting lastSequence to 3 from( null)
06-19 09:39:04.907: V/TDDatabase(8313): *** com.couchbase.touchdb.replicator.TDReplicator$1@417f8ec8: END processInbox (lastSequence=3
06-19 09:39:04.970: V/TDDatabase(8313): TDPusher [http://bob1.t2.local:5984/grocery-sync1] checkpointing sequence=174
06-19 09:39:04.993: V/TDDatabase(8313): TDPusher [http://bob1.t2.local:5984/grocery-sync1]: PUT ./_local/f2c42f0bbfce86242c71d8d88665952e0bc5af31
06-19 09:39:05.032: V/TDDatabase(8313): com.couchbase.touchdb.support.TDRemoteRequest@4193e658: PUT .http://bob1.t2.local:5984/grocery-sync1/_local/f2c42f0bbfce86242c71d8d88665952e0bc5af31
06-19 09:39:05.431: D/dalvikvm(8313): GC_CONCURRENT freed 1772K, 7% free 27530K/29383K, paused 2ms+5ms
06-19 09:39:05.501: I/BFDemo(8313): onPause
06-19 09:39:05.985: I/BFDemo(8313): surfaceDestroyed
06-19 09:39:06.540: I/BFDemo(8313): onDestroy
06-19 09:39:06.564: V/TDDatabase(8313): TDPusher [http://bob1.t2.local:5984/grocery-sync1] STOPPING...
06-19 09:39:06.564: D/TDDatabase(8313): in stopped
06-19 09:39:06.564: V/TDDatabase(8313): Chagne tracker run loop exiting
06-19 09:39:06.571: V/TDDatabase(8313): TDPuller [http://bob1.t2.local:5984/grocery-sync1] STOPPED
06-19 09:39:07.071: E/TDDatabase(8313): Error getting doc numeric id
06-19 09:39:07.071: E/TDDatabase(8313): java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:07.071: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:07.071: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1556)
06-19 09:39:07.071: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1538)
06-19 09:39:07.071: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.getDocNumericID(TDDatabase.java:757)
06-19 09:39:07.071: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.getRevisionHistory(TDDatabase.java:905)
06-19 09:39:07.071: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.getRevisionHistoryDict(TDDatabase.java:1032)
06-19 09:39:07.071: E/TDDatabase(8313): at com.couchbase.touchdb.replicator.TDPusher$2.onCompletion(TDPusher.java:186)
06-19 09:39:07.071: E/TDDatabase(8313): at com.couchbase.touchdb.support.TDRemoteRequest$2.run(TDRemoteRequest.java:176)
06-19 09:39:07.071: E/TDDatabase(8313): at android.os.Handler.handleCallback(Handler.java:605)
06-19 09:39:07.071: E/TDDatabase(8313): at android.os.Handler.dispatchMessage(Handler.java:92)
06-19 09:39:07.071: E/TDDatabase(8313): at android.os.Looper.loop(Looper.java:137)
06-19 09:39:07.071: E/TDDatabase(8313): at android.os.HandlerThread.run(HandlerThread.java:60)
06-19 09:39:07.095: E/TDDatabase(8313): TDRemoteRequestCompletionBlock throw Exception
06-19 09:39:07.095: E/TDDatabase(8313): java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:07.095: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:07.095: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1556)
06-19 09:39:07.095: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1538)
06-19 09:39:07.095: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.loadRevisionBody(TDDatabase.java:734)
06-19 09:39:07.095: E/TDDatabase(8313): at com.couchbase.touchdb.replicator.TDPusher$2.onCompletion(TDPusher.java:177)
06-19 09:39:07.095: E/TDDatabase(8313): at com.couchbase.touchdb.support.TDRemoteRequest$2.run(TDRemoteRequest.java:176)
06-19 09:39:07.095: E/TDDatabase(8313): at android.os.Handler.handleCallback(Handler.java:605)
06-19 09:39:07.095: E/TDDatabase(8313): at android.os.Handler.dispatchMessage(Handler.java:92)
06-19 09:39:07.095: E/TDDatabase(8313): at android.os.Looper.loop(Looper.java:137)
06-19 09:39:07.095: E/TDDatabase(8313): at android.os.HandlerThread.run(HandlerThread.java:60)
06-19 09:39:07.384: D/dalvikvm(8313): GC_CONCURRENT freed 2130K, 8% free 27380K/29575K, paused 2ms+4ms
06-19 09:39:07.696: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:07.696: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:07.696: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:07.696: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:07.696: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:07.696: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:07.696: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:07.696: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:07.696: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:07.696: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:07.696: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:07.696: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:07.696: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:07.696: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:07.696: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:07.696: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:07.696: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:07.696: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:07.696: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:07.696: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:07.696: E/TDDatabase(8313): ... 16 more
06-19 09:39:07.907: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:07.907: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:07.907: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:07.907: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:07.907: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:07.907: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:07.907: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:07.907: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:07.907: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:07.907: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:07.907: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:07.907: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:07.907: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:07.907: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:07.907: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:07.907: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:07.907: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:07.907: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:07.907: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:07.907: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:07.907: E/TDDatabase(8313): ... 16 more
06-19 09:39:08.243: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:08.243: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:08.243: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:08.243: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:08.243: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:08.243: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:08.243: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:08.243: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:08.243: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:08.243: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:08.243: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:08.243: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:08.243: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:08.243: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:08.243: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:08.243: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:08.243: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:08.243: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:08.243: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:08.243: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:08.243: E/TDDatabase(8313): ... 16 more
06-19 09:39:08.345: V/TDCollateJSON(8313): SQLite3 handle is 9210472
06-19 09:39:08.399: V/TDCollateJSON(8313): SQLite3 handle is 8334448
06-19 09:39:08.759: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:08.759: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:08.759: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:08.759: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:08.759: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:08.759: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:08.759: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:08.759: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:08.759: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:08.759: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:08.759: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:08.759: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:08.759: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:08.759: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:08.759: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:08.759: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:08.759: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:08.759: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:08.759: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:08.759: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:08.759: E/TDDatabase(8313): ... 16 more
06-19 09:39:08.829: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:08.829: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:08.829: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:08.829: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:08.829: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:08.829: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:08.829: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:08.829: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:08.829: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:08.829: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:08.829: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:08.829: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:08.829: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:08.829: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:08.829: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:08.829: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:08.829: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:08.829: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:08.829: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:08.829: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:08.829: E/TDDatabase(8313): ... 16 more
06-19 09:39:08.970: D/dalvikvm(8313): GC_CONCURRENT freed 1936K, 8% free 27407K/29575K, paused 3ms+4ms
06-19 09:39:09.017: E/SQLiteDatabase(8313): close() was never explicitly called on database '/data/data/com.t2.bioheart/files/grocery-sync.touchdb' 
06-19 09:39:09.017: E/SQLiteDatabase(8313): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
06-19 09:39:09.017: E/SQLiteDatabase(8313): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1943)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1007)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:962)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at com.couchbase.touchdb.TDDatabase.open(TDDatabase.java:223)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at com.couchbase.touchdb.router.TDRouter.openDB(TDRouter.java:223)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:293)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:09.017: E/SQLiteDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:09.353: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:09.353: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:09.353: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:09.353: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:09.353: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:09.353: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:09.353: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:09.353: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:09.353: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:09.353: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:09.353: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:09.353: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:09.353: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:09.353: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:09.353: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:09.353: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:09.353: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:09.353: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:09.353: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:09.353: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:09.353: E/TDDatabase(8313): ... 16 more
06-19 09:39:09.485: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:09.485: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:09.485: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:09.485: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:09.485: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:09.485: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:09.485: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:09.485: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:09.485: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:09.485: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:09.485: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:09.485: E/TDDatabase(8313): ... 16 more
06-19 09:39:09.485: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:09.485: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:09.485: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:09.485: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:09.485: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:09.485: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:09.485: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:09.485: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:09.485: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:09.485: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:09.485: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:09.485: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:09.485: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:09.485: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:09.485: E/TDDatabase(8313): ... 16 more
06-19 09:39:09.524: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:09.524: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:09.524: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:09.524: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:370)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:206)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.put(TouchDBHttpClient.java:162)
06-19 09:39:09.524: E/TDDatabase(8313): at org.ektorp.http.RestTemplate.put(RestTemplate.java:43)
06-19 09:39:09.524: E/TDDatabase(8313): at org.ektorp.impl.StdCouchDbConnector.create(StdCouchDbConnector.java:119)
06-19 09:39:09.524: E/TDDatabase(8313): at com.t2.bioheart.DataOutHandler$5.doInBackground(DataOutHandler.java:428)
06-19 09:39:09.524: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:29)
06-19 09:39:09.524: E/TDDatabase(8313): at org.ektorp.android.util.EktorpAsyncTask.doInBackground(EktorpAsyncTask.java:21)
06-19 09:39:09.524: E/TDDatabase(8313): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-19 09:39:09.524: E/TDDatabase(8313): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 09:39:09.524: E/TDDatabase(8313): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 09:39:09.524: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-19 09:39:09.524: E/TDDatabase(8313): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-19 09:39:09.524: E/TDDatabase(8313): at java.lang.Thread.run(Thread.java:856)
06-19 09:39:09.524: E/TDDatabase(8313): Caused by: java.lang.IllegalStateException: database /data/data/com.t2.bioheart/files/grocery-sync.touchdb (conn# 0) already closed
06-19 09:39:09.524: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-19 09:39:09.524: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:639)
06-19 09:39:09.524: E/TDDatabase(8313): at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:552)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.beginTransaction(TDDatabase.java:389)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.TDDatabase.putRevision(TDDatabase.java:1910)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1102)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.update(TDRouter.java:1111)
06-19 09:39:09.524: E/TDDatabase(8313): at com.couchbase.touchdb.router.TDRouter.do_PUT_Document(TDRouter.java:1144)
06-19 09:39:09.524: E/TDDatabase(8313): ... 16 more
06-19 09:39:09.610: D/BFDemo(8313): Document added to database successfully
06-19 09:39:09.634: D/BFDemo(8313): Document added to database successfully
06-19 09:39:09.720: E/TDDatabase(8313): Exception in TDRouter
06-19 09:39:09.720: E/TDDatabase(8313): java.lang.reflect.InvocationTargetException
06-19 09:39:09.720: E/TDDatabase(8313): at java.lang.reflect.Method.invokeNative(Native Method)
06-19 09:39:09.720: E/TDDatabase(8313): at java.lang.reflect.Method.invoke(Method.java:511)

scott coleman

unread,
Jun 21, 2012, 1:44:37 PM6/21/12
to mobile-c...@googlegroups.com
I think the problem is in that adding an item uses AsyncTask (I'm doing it like in GrocerySyncActivity) which spawns a thread. This thread potentially still exists after the application is destroyed.

This brings up the question: How to safely terminate an application that uses TouchDB. Is there a way to determine when TouchDB is completely done processing? Or is there another way of terminating which stops all threads?

Marty Schoch

unread,
Jun 21, 2012, 1:55:36 PM6/21/12
to mobile-c...@googlegroups.com
Yes it does appear that is whats happening. However, I'm more
concerned that none of the adds took place until after you started
destroy. It almost looks like they were all blocked on something,
then some part of the shutdown unblocked them. But then it actually
shutdown before they finished, which caused these exceptions.

Is it correct that you log "Beat Detected", then start an AsyncTask to
create the document, and then in onSuccess() you log "document created
successfully"?

marty

scott coleman

unread,
Jun 21, 2012, 6:32:56 PM6/21/12
to mobile-c...@googlegroups.com
Yes, that's correct. Here's the flow:
Log.e(TAG," Beat Detected ");
DataOutPacket packet = mDataOutHandler.new DataOutPacket();
packet.add(DataOutHandler.HRV_RAW_IBI, hrvData.mRawInterval);
packet.add(DataOutHandler.HRV_RAW_SDNN, hrvData.mSdnn, "%2.2f");
mDataOutHandler.handleDataOut(packet);

    T2EktorpAsyncTask createItemTask = new T2EktorpAsyncTask() {

@Override
protected void doInBackground() {
couchDbConnector.create(packet.mItem);

scott coleman

unread,
Jun 22, 2012, 11:45:52 AM6/22/12
to mobile-c...@googlegroups.com
Tried updating GrocerySyncApp to create a bunch of items then exited the app. Different Exceptions, not sure if these are related or not;
06-22 08:39:22.463: V/TDDatabase(26916): Begin transaction (level 1)...
06-22 08:39:22.487: V/TDDatabase(26916): Committing transaction (level 1)...
06-22 08:39:23.580: W/IInputConnectionWrapper(26916): showStatusIcon on inactive InputConnection
06-22 08:39:23.612: V/TDDatabase(26916): TDPusher [http://bob1.t2.local:5984/grocery-sync1]: Received #25 {1340379560703-35778299-27ed-455a-aae3-e51686dd7471 #1-cc050376-2234-447d-bd35-537a65cc122c}
06-22 08:39:23.612: W/TDDatabase(26916): TDRouter: Sending continous change chunk
06-22 08:39:24.346: V/GrocerySync(26916): onDestroy
06-22 08:39:24.346: V/TDDatabase(26916): TDPusher [http://bob1.t2.local:5984/grocery-sync1] STOPPED
06-22 08:39:24.354: V/TDDatabase(26916): *** com.couchbase.touchdb.replicator.TDReplicator$1@41a0df50: BEGIN processInbox (1 sequences)
06-22 08:39:24.354: V/TDDatabase(26916): TDPusher [http://bob1.t2.local:5984/grocery-sync1]: POST ./_revs_diff
06-22 08:39:24.377: V/TDDatabase(26916): *** com.couchbase.touchdb.replicator.TDReplicator$1@41a0df50: END processInbox (lastSequence=24
06-22 08:39:24.377: D/TDDatabase(26916): in stopped
06-22 08:39:24.377: V/TDDatabase(26916): Chagne tracker run loop exiting
06-22 08:39:24.385: V/TDDatabase(26916): TDPuller [http://bob1.t2.local:5984/grocery-sync1] STOPPED
06-22 08:39:24.385: V/TDDatabase(26916): com.couchbase.touchdb.support.TDRemoteRequest@417dc268: POST .http://bob1.t2.local:5984/grocery-sync1/_revs_diff
06-22 08:39:24.604: I/ContinuousChangesFeed(26916): Changes feed was interrupted
06-22 08:39:26.690: V/TDCollateJSON(26916): SQLite3 handle is 7875640
06-22 08:39:26.768: E/TDDatabase(26916): Error getting doc numeric id
06-22 08:39:26.768: E/TDDatabase(26916): java.lang.IllegalStateException: database /data/data/com.couchbase.grocerysync/files/grocery-sync.touchdb (conn# 0) already closed
06-22 08:39:26.768: E/TDDatabase(26916): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)
06-22 08:39:26.768: E/TDDatabase(26916): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1556)
06-22 08:39:26.768: E/TDDatabase(26916): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1538)
06-22 08:39:26.768: E/TDDatabase(26916): at com.couchbase.touchdb.TDDatabase.getDocNumericID(TDDatabase.java:757)
06-22 08:39:26.768: E/TDDatabase(26916): at com.couchbase.touchdb.TDDatabase.getRevisionHistory(TDDatabase.java:905)
06-22 08:39:26.768: E/TDDatabase(26916): at com.couchbase.touchdb.TDDatabase.getRevisionHistoryDict(TDDatabase.java:1032)
06-22 08:39:26.768: E/TDDatabase(26916): at com.couchbase.touchdb.replicator.TDPusher$2.onCompletion(TDPusher.java:193)
06-22 08:39:26.768: E/TDDatabase(26916): at com.couchbase.touchdb.support.TDRemoteRequest$2.run(TDRemoteRequest.java:176)
06-22 08:39:26.768: E/TDDatabase(26916): at android.os.Handler.handleCallback(Handler.java:605)
06-22 08:39:26.768: E/TDDatabase(26916): at android.os.Handler.dispatchMessage(Handler.java:92)
06-22 08:39:26.768: E/TDDatabase(26916): at android.os.Looper.loop(Looper.java:137)
06-22 08:39:26.768: E/TDDatabase(26916): at android.os.HandlerThread.run(HandlerThread.java:60)
06-22 08:39:26.768: I/TDDatabase(26916): com.couchbase.touchdb.replicator.TDPusher$2@417e2148: Sending 1 revisions
06-22 08:39:26.768: V/TDDatabase(26916): com.couchbase.touchdb.replicator.TDPusher$2@417e2148: Sending [{1340379560703-35778299-27ed-455a-aae3-e51686dd7471 #1-cc050376-2234-447d-bd35-537a65cc122c}]
06-22 08:39:26.776: V/TDDatabase(26916): TDPusher [http://bob1.t2.local:5984/grocery-sync1]: POST ./_bulk_docs
06-22 08:39:26.807: V/TDDatabase(26916): com.couchbase.touchdb.support.TDRemoteRequest@4199adb0: POST .http://bob1.t2.local:5984/grocery-sync1/_bulk_docs
06-22 08:39:27.151: D/GrocerySync(26916): Document created successfully
06-22 08:39:27.588: V/TDDatabase(26916): Begin transaction (level 1)...
06-22 08:39:28.979: E/TDDatabase(26916): Got error 500
06-22 08:39:28.979: E/TDDatabase(26916): Request was for: org.apache.http.client.methods.HttpPost@4198d8c8
06-22 08:39:28.979: E/TDDatabase(26916): Status reason: Internal Server Error
06-22 08:39:28.987: V/TDDatabase(26916): TDPusher [http://bob1.t2.local:5984/grocery-sync1] STOPPED
06-22 08:39:28.994: E/TDDatabase(26916): TDRemoteRequestCompletionBlock throw Exception
06-22 08:39:28.994: E/TDDatabase(26916): java.lang.NullPointerException
06-22 08:39:28.994: E/TDDatabase(26916): at com.couchbase.touchdb.support.TDBatcher.close(TDBatcher.java:102)
06-22 08:39:28.994: E/TDDatabase(26916): at com.couchbase.touchdb.replicator.TDReplicator.stopped(TDReplicator.java:202)
06-22 08:39:28.994: E/TDDatabase(26916): at com.couchbase.touchdb.replicator.TDReplicator.asyncTaskFinished(TDReplicator.java:222)
06-22 08:39:28.994: E/TDDatabase(26916): at com.couchbase.touchdb.replicator.TDPusher$2$1.onCompletion(TDPusher.java:222)
06-22 08:39:28.994: E/TDDatabase(26916): at com.couchbase.touchdb.support.TDRemoteRequest$2.run(TDRemoteRequest.java:176)
06-22 08:39:28.994: E/TDDatabase(26916): at android.os.Handler.handleCallback(Handler.java:605)
06-22 08:39:28.994: E/TDDatabase(26916): at android.os.Handler.dispatchMessage(Handler.java:92)
06-22 08:39:28.994: E/TDDatabase(26916): at android.os.Looper.loop(Looper.java:137)
06-22 08:39:28.994: E/TDDatabase(26916): at android.os.HandlerThread.run(HandlerThread.java:60)
06-22 08:39:29.018: V/TDDatabase(26916): Committing transaction (level 1)...
06-22 08:39:30.690: D/GrocerySync(26916): Document created successfully
06-22 08:39:30.893: V/TDDatabase(26916): Begin transaction (level 1)...
06-22 08:39:30.916: V/TDDatabase(26916): Committing transaction (level 1)...
06-22 08:39:32.830: D/dalvikvm(26916): GC_CONCURRENT freed 408K, 16% free 14034K/16519K, paused 3ms+3ms
06-22 08:39:32.955: D/GrocerySync(26916): Document created successfully

Marty Schoch

unread,
Jun 22, 2012, 12:05:42 PM6/22/12
to mobile-c...@googlegroups.com
I think the first thing we need to do is figure out what is the
desired behavior you'r trying to get. Obviously it would be nice if
TouchDB didn't throw so many exceptions (at least one of these below
is a bug), but real problem here looks like you can't work with a
database after its shutdown.

Option 1:

In onDestroy you flag something so that you stop collecting new data.
Then you wait for TouchDB to store all the data you've collected so
far. Finally once this is done you shutdown TouchDB.

Option 2:

In onDestroy you cancel any in progress tasks to save data (or
otherwise just accept that they will fail) and proceed to immediately
shutdown TouchDB.

Even if you go with option 1 you'll need some sort of hard timeout at
which point you stop waiting and shutdown anyway (otherwise you may
get an ANR)

marty

scott coleman

unread,
Jun 25, 2012, 12:13:23 PM6/25/12
to mobile-c...@googlegroups.com
Is there a callback I an implement to be notified when TouchDB is done with processing an Add?
Reply all
Reply to author
Forward
0 new messages