sockeqwe / sqlbrite-dao

DAO for SQLBrite
http://hannesdorfmann.com/android/sqlbrite-dao
Apache License 2.0
182 stars 22 forks source link

SQLiteDatabaseLockedException: database is locked (code 5) #49

Open praveen2gemini opened 7 years ago

praveen2gemini commented 7 years ago

@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)); }

sockeqwe commented 7 years ago

I'm not sure if this is related to this library.

praveen2gemini commented 7 years ago

No we have only one DaoManager. We're using Dagger2 It will be singleton. Transactions not in our control.