Sunday, 6 January 2019

Room and SQLiteDatabaseCorruptException

Just saw one report in my play console:

android.database.sqlite.SQLiteDatabaseCorruptException: 
  at android.database.sqlite.SQLiteConnection.nativePrepareStatement (Native Method)
  at android.database.sqlite.SQLiteConnection.acquirePreparedStatement (SQLiteConnection.java:903)
  at android.database.sqlite.SQLiteConnection.executeForString (SQLiteConnection.java:648)
  at android.database.sqlite.SQLiteConnection.setJournalMode (SQLiteConnection.java:333)
  at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration (SQLiteConnection.java:298)
  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:217)
  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:195)
  at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked (SQLiteConnectionPool.java:503)
  at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:204)
  at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:196)
  at android.database.sqlite.SQLiteDatabase.openInner (SQLiteDatabase.java:920)
  at android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:908)
  at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:767)
  at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:757)
  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:355)
  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:298)
  at android.arch.persistence.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:96)
  at android.arch.persistence.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:54)
  at android.arch.persistence.room.RoomDatabase.query (RoomDatabase.java:233)
  at org.walleth.data.transactions.TransactionDAO_Impl$8.compute (TransactionDAO_Impl.java:1228)
  at org.walleth.data.transactions.TransactionDAO_Impl$8.compute (TransactionDAO_Impl.java:1214)
  at android.arch.lifecycle.ComputableLiveData$2.run (ComputableLiveData.java:100)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)

Anyone knows a good way to deal with these? Especially when using LiveData I do not yet see a good way to handle this problem. Also what would be a good way to reproduce this - so how do I corrupt the database elegantly?



from Room and SQLiteDatabaseCorruptException

No comments:

Post a Comment