Re: SQLite Server
- Posted by ghaberek (admin) Jan 04, 2017
- 1553 views
Good news! SQLite v3 handles all of this for you. Just carry on doing your thing and the library will automatically lock/wait/unlock between processes as necessary. It's like magic!
You will probably experience delays if you're trying to write from multiple processes at the same time. Multiple processes reading from the same database should be effectively delay-free.
See also:
- File Locking And Concurrency In SQLite Version 3
- Can multiple applications or multiple instances of the same application access a single database file at the same time?
Edit: Sorry, I guess this doesn't happen automatically. You'll have to call sqlite3_busy_timeout() as indicated here: Set A Busy Timeout. Then, as long as your writes stay under the timeout, the library will automatically wait for a slot to open and write the database.
-Greg