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

WAL pitfalls #10

Open
brodycj opened this issue Mar 9, 2017 · 8 comments
Open

WAL pitfalls #10

brodycj opened this issue Mar 9, 2017 · 8 comments

Comments

@brodycj
Copy link

brodycj commented Mar 9, 2017

As I said in storesafe/cordova-sqlite-storage#643 (comment):

In general I do not really favor WAL (write ahead logging ref: https://www.sqlite.org/wal.html) since it would require the overhead of checkpointing at certain intervals. I also just discovered an interesting issue at http://stackoverflow.com/questions/39149065/sqlite-write-ahead-logging-wal-journal-mode-with-attached-database.

@philonor
Copy link

philonor commented Nov 6, 2017

@brodybits What is the current status on WAL? Is it still disabled by default for the cordova-sqlite-** plugins, or is it necessary to disable it manually? I have a weird issue on iOS with https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free where the database gets emptied from time to time, but unfortunately I can't reproduce it yet, so I'm trying to ensure that I am not running into any pitfall I'm not aware of.
https://stackoverflow.com/a/18870738/5062057
https://stackoverflow.com/q/17487306/5062057

@brodycj
Copy link
Author

brodycj commented Dec 17, 2017

What is the current status on WAL?

WAL is not be enabled on any platforms. Test at litehelpers / Cordova-sqlite-storage / spec / www / spec / sqlite-version-test.js#L126-L144 shows PRAGMA journal_mode returns delete or persist as described at: https://sqlite.org/pragma.html#pragma_journal_mode

It should be no problem to change using a PRAGMA statement, though I have not tested this.

https://stackoverflow.com/a/18870738/5062057
https://stackoverflow.com/q/17487306/5062057

Links expanded to:

This plugin does not deal with iOS CoreData.

For the next major release (storesafe/cordova-sqlite-storage#687) I would like to update the plugin to explicitly set PRAGMA journal_mode to persist in all cases in order to minimize the number of possible deviations between the different platform implementations.

@brodycj
Copy link
Author

brodycj commented Dec 19, 2017

@brodycj
Copy link
Author

brodycj commented Dec 29, 2017

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:

@brodycj
Copy link
Author

brodycj commented Jan 11, 2018

Adding the following Q&A that I initiated on the SQLite forum for reference (with a single response which I think has no new information):

@brodycj
Copy link
Author

brodycj commented Jan 12, 2020

@brodycj
Copy link
Author

brodycj commented Mar 11, 2020

I just found a couple more resources today:

@brodycj
Copy link
Author

brodycj commented Mar 11, 2020

includes a description of how to use a PRAGMA for manual checkpointing - definitely looks like a drawback to me

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

No branches or pull requests

2 participants