Skip to content
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

Parallel reader/writer failures #1

Open
brodycj opened this issue Dec 28, 2017 · 1 comment
Open

Parallel reader/writer failures #1

brodycj opened this issue Dec 28, 2017 · 1 comment
Labels

Comments

@brodycj
Copy link
Owner

brodycj commented Dec 28, 2017

A client reported failures when testing with multiple readers running in parallel with a writer due to database locking. The solution is to fix the CoffeeScript/JavaScript to manage queue locking between the main database handle (with write access) and the parallel readers with a similar state-based locking style as described in https://www.sqlite.org/lockingv3.html.

Alternative may be to use WAL. Pitfalls of WAL discussed in storesafe/cordova-sqlite-storage-help#10. I wonder if WAL may be less vulnerable to database corruption due to its more sequential nature, for further investigation.

@brodycj brodycj added the bug label Dec 28, 2017
@brodycj
Copy link
Owner Author

brodycj commented Dec 29, 2017

Alternative solution may be to use WAL. From https://www.sqlite.org/wal.html#overview:

WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently.

Another advantage of WAL is that it may be more robust against possible corruption. From storesafe/cordova-sqlite-storage-help#10 (comment):

I was thinking that WAL may be more robust against possible database corruption and found a couple threads that confirm WAL may be more reliable, at least in certain cases:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant