Replies: 2 comments
-
Does this happen frequently? Are you opening the same drift isolate on multiple isolates? Or do you have one connection in drift and one outside of drift (including native code with your app possibly accessing the database)? This should not happen when using a database with drift alone because drift has an internal async lock for the database. But if you're opening the same database file multiple times, there might be conflicts. Unfortunately I'm not a way to debug these issues (or printing where the lock was obtained). So the first step is determining where the database is opened and where it might be used concurrently. |
Beta Was this translation helpful? Give feedback.
-
Hi Simon,
thanks for the ideas. I only see that sporadically. So what might happen is that the application code is running in the background due to a firebase trigger when the user opens the UI. On Android flutter this results in two isolates, which might be the cause for opening the database multiple times in different isolates. I'll try to check that and make those isolates mutually exclusive...
Thanks,
Martin
Am 18. November 2024 00:12:00 MEZ schrieb Simon Binder ***@***.***>:
Does this happen frequently? Are you opening the same drift isolate on multiple isolates? Or do you have one connection in drift and one outside of drift (including native code with your app possibly accessing the database)?
This should not happen when using a database with drift alone because drift has an internal async lock for the database. But if you're opening the same database file multiple times, there might be conflicts. Unfortunately I'm not a way to debug these issues (or printing where the lock was obtained). So the first step is determining where the database is opened and where it might be used concurrently.
--
Reply to this email directly or view it on GitHub:
#3343 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
--
Martin Clauss
Meine Contactulater Card - All meine Kontaktinfo immer aktuell und vollständig:
https://contactulater.app/me/mc
|
Beta Was this translation helpful? Give feedback.
-
Hi folks, I do have a sporadic issue resulting in a SQLite "database is locked" error, however I'm not sure how to debug/resolve this. Are there any hints for solving this?
Drift version: "2.19.1+1"
Stacktrace looks like this:
Any help appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions