-
Notifications
You must be signed in to change notification settings - Fork 505
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
DB Error: database is locked #16
Comments
I think this case only happens on the Android side because I already queued all write to DB actions on iOS. My main idea is: lock for write and allow read always. By the way, I forgot running a transaction when I insert a new task into DB. That would account for this bug. |
Sorry I forgot to mention that I only tried this on iOS so far. This is where the bug occurs. |
Is there any log for this case? |
|
That would be the problem of multiple threads. Two threads access to DB at the moment and as far as the logs run, the later action was failed by DB locked then it returns an empty object, the saved file path can't be loaded, so application crashed because the function [NSURL initFileURLWithPath:] doesn't accept a nil value. That's the case I read from your logs. |
By the way, I am quite busy during the week. There can be time at the weekend. So I am willing if you can contribute to this repository. |
I tried implementing a retry loop but it seemed quite ugly and didn't fully work. But I'd give it another shot. Objc is pretty new for me though. We could also have the DB handler in one thread and give it the data through a queue. |
When one download finishes while others are being created it can happen that the DB is locked.
The text was updated successfully, but these errors were encountered: