unexpected SQLiteReadOnlyDatabaseException
This exception has happened much after the database was opened and used. I initialize DBFlow on startup. Then I was using DBFlow for both reading and writing for a while (just several selects, inserts and updates without any stress). Then after a short pause on a new update this happened. I can't reproduce it anymore, so I assume that it's rare. It's still very important to fix, because it crashes the whole app.
E/SQLiteLog(15743): (1032) statement aborts at 45: [UPDATE OR ABORT MyModel SET x=?,y=?,z=? WHERE `id`='...'
Caused by: android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:734)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1576)
at com.raizlabs.android.dbflow.SQLiteCompatibilityUtils.updateWithOnConflict(SQLiteCompatibilityUtils.java:63)
at com.raizlabs.android.dbflow.sql.SqlUtils.update(SqlUtils.java:289)
at com.raizlabs.android.dbflow.sql.SqlUtils.save(SqlUtils.java:264)
at com.raizlabs.android.dbflow.structure.ModelAdapter.save(ModelAdapter.java:54)
at com.raizlabs.android.dbflow.structure.BaseModel.save(BaseModel.java:50)
...
It will happen if you call FlowManager.init more than one time for the same app. Be sure to only call that method one time.
It's only called once on startup. This exception has happened after using DBFlow for a while, and I don't mess with the database in any other way (it's never closed or reopened).
check if this isn't related to #238
this is most likely outdated.