Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support busy timeout setting for SQLite driver
Some operations may not take place in parallel. In that case, by default, SQLite will return a "database is locked" error. This creates problems for multi-threaded applications that happen to do two such operations at the same time. Most of the time, having one wait a little while resolves the situation. The SQLite library makes this easy to set up, providing a way to install a time-based busy handler. This commit adds support for setting the busy timeout when creating a new SQLite connection, and also defaults it to 10s, which will give a much better experience to the average user who takes this module and starts doing stuff with it from multiple threads. The previous default (since we didn't call the `sqlite3_busy_timeout` function) was zero, meaning that using multiple connection objects, one per thread, left the user quite likely to run into the busy error.
- Loading branch information