SimpleNoSQL
SimpleNoSQL copied to clipboard
Crash due to database lock (Random)
Getting random crashes due to database lock, even when I' writing only once in a bucket on a activity
Crash Log
android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:780) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1473) at com.colintmiller.simplenosql.db.SimpleNoSQLDBHelper.saveEntity(SimpleNoSQLDBHelper.java:70) at com.colintmiller.simplenosql.threading.DataDispatcher.save(DataDispatcher.java:96) at com.colintmiller.simplenosql.threading.DataDispatcher.run(DataDispatcher.java:77)
I would recommend setting the threads to one for now. I haven't had time to update the threading and storage logic. However running single threaded should still be fine unless you're doing a large amount of transactions. Even then it's a problem that SQLite will give you by default.
I'm using it for e-commerce application to store data fetched from network, I tried changing the threads but while running again it gives random crashes so don't know why it worked last time not now