-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
java.sql.SQLException: database is locked #105
Comments
While switching to a DB that supports concurrency is probably the right long-term approach, a low-fi short-term fix might be to use a If we were at all concerned about overall throughput this would be a disastrous suggestion, but as a mechanism for avoiding nasty exceptions while we regroup and come up with a better long-term solution, what do you think, @ato? |
If it works on a retry, then another possibility might be adding automatic retries to promotion. |
OK, upon further digging it looks like SQLite can do the right thing without any special locking; it's just a case of bad defaults: http://sqlite.org/c3ref/busy_timeout.html Unfortunately the while jdbc driver has a (swap! korma.db/_default assoc :pool (delay (:db config))) But even at that point all we have is an http://sqlitejdbc.sourceforge.jp/org/sqlite/Database.html#setBusyTimeout(int) Will continue digging. |
The plot thickens: there are actually two separate SQLite JDBC drivers that both use the The one we are using does not expose a https://bitbucket.org/xerial/sqlite-jdbc/issue/27/allow-user-to-specify-busy-timeout-when However, setting it has no effect on the timeout; we still get a locking error about 50% of the time well before the timeout has expired. |
Aha; so it turns out that while |
This happened once earlier, retrying just "fixed" it, but this might worth a report.
Here is the log:
The text was updated successfully, but these errors were encountered: