-
Notifications
You must be signed in to change notification settings - Fork 378
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
database is locked (help me) #1042
Comments
Do you only get that on production or can you reproduce this in development too? Are you opening multiple databases at the same time? |
I cannot reproduce it in development. I send log to my dev/real server. But I dont have any logs in dev server by now. By the way, I am using android home widget and android WorkManager (for timer). So I execute dart code with isolate on background. (https://medium.com/stuart-engineering/keep-flutter-running-background-on-android-6ffc85be0234). |
If there are multiple databases open at the same time, the locking issue can happen (especially if one of them has a long-running transaction or many writes). You might be able to fix that by just retrying when a database is locked, but I'm not sure if that might have other downsides as well. |
Hi, @simolus3. Long time no see. I am still struggling with this issue. Case 1. debug(hot restart) + Android
Transaction takes 20 seconds and 'yourdbfile-journal' will be made. (my PRAMGA journal_mode is 'delete', default value) Case 2. real (or profile) + Android + unexpected MainActivity onDestroy Go to Setting > Developer Options.
Make transaction takes 20 seconds like Case 1. *My workaround on Case 2.
In flutter, receive 'onDestroyMainActivity' and close database. This workaround has downsides.
Any other good idea? I think there are more case but I need more time |
What about using |
I don't have any clue.
I found that #648, but I guess it is not my case
It happens randomly on just normal update (just one row or more)
Any idea? please help me!
The text was updated successfully, but these errors were encountered: