-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
panic: "database table is locked" when multiple writes occur concurrently #50
Comments
I'm getting some "database table is locked" errors as well when doing some concurrent reading & writing. |
@spiffytech What version of sqlite do you use? |
$ sqlite3 --version I think I got that from MacPorts. I tried enabling WAL mode and continued to get the error. |
Merge into #161 |
I am using the following connection string |
I think the first aspect to clear would be if go-sqlite3 itself is goroutine-safe, e.g. if a single instance can be called from multiple goroutines. Although related, such aspect is separate from the internal SQLite3 locking mechanism (which of course is a nice feature to use) that can work across different processes. |
I encountered the problem from Issue 39 and applied the resolution of adding "?cache=shared&mode=rwc" to my open string. Now, when multiple writers run concurrently, I encounter a different error:
Some research indicate SQLite has an API for waiting for the locking query to finish so the next query can be run. Please implement this, so that manually managing concurrent writes, or write retries, is unnecessary.
https://www.sqlite.org/unlock_notify.html
The text was updated successfully, but these errors were encountered: