Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash due to database lock (Random) #36

Open
ghost opened this issue Dec 8, 2016 · 2 comments
Open

Crash due to database lock (Random) #36

ghost opened this issue Dec 8, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 8, 2016

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)

@Jearil
Copy link
Owner

Jearil commented Dec 8, 2016

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.

@ghost
Copy link
Author

ghost commented Dec 8, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant