sqlbrite-dao
sqlbrite-dao copied to clipboard
SQLiteDatabaseLockedException: database is locked (code 5)
@sockeqwe Can we have any suggestion on this issue? It'd helpful to identify the loop hole. SqlBrite Version is sqlDaoVer = '0.4.1'
My crash report from Android Monitor:
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:782) 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:1472) at com.squareup.sqlbrite.BriteDatabase.insert(BriteDatabase.java:351) at com.hannesdorfmann.sqlbrite.dao.Dao.insert(Dao.java:243)
This report takes me to Dao.java code and following line:
protected Observable<Long> insert (final String table, final ContentValues contentValues, final int conflictAlgorithm) { return Observable.just(db.insert(table, contentValues, conflictAlgorithm)); }
I'm not sure if this is related to this library.
- Do you instantiate mulitple DaoManager?
- Do you close all transactions?
No we have only one DaoManager. We're using Dagger2 It will be singleton. Transactions not in our control.