rodrigojmlourenco / TrackerProto

Prototype for the TRACE Tracker App
0 stars 0 forks source link

[BUG@store-client] Sudden app crash #6

Closed rodrigojmlourenco closed 8 years ago

rodrigojmlourenco commented 8 years ago
Java.lang.RuntimeException: Unable to start receiver org.trace.storeclient.cache.CacheConnectivityMonitor: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/pt.inesc_id.cycletoshop/databases/Routes.db
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:2732)
    at android.app.ActivityThread.-wrap14(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/pt.inesc_id.cycletoshop/databases/Routes.db
    at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:55)
    at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:992)
    at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:831)
    at android.database.DatabaseUtils.queryNumEntries(DatabaseUtils.java:810)
    at android.database.DatabaseUtils.queryNumEntries(DatabaseUtils.java:791)
    at org.trace.storeclient.cache.storage.RouteStorage.hasPendingRoutes(RouteStorage.java:503)
    at org.trace.storeclient.cache.RouteCache.postPendingRoutes(RouteCache.java:147)
    at org.trace.storeclient.cache.CacheConnectivityMonitor.onReceive(CacheConnectivityMonitor.java:67)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:2725)
    ... 8 more
rodrigojmlourenco commented 8 years ago

The problem was addressed by closing the db in all methods of the RouteStorage component. However, at this stage it is still not clear if this is enough.

rodrigojmlourenco commented 8 years ago

The problem appears to be have been solves, through the described solution, as no more sudden crashes due to closed databases were registered.