I've read many threads about the new WAL default setting in ios7 SQLite / Core Data stack.
It looked like a good idea in the first place... Though I need to perform a database copy to a distant webservice from time to time according to my business needs. At the moment I only backup the SQLITE file and I can't add the 2 other files to the webservice operation I'm using. This means my backup is clearly not up-to-date thus pretty pointless.
Other people suggest that I should disable WAL using the journal_mode=DELETE (NSSQLitePragmasOption) which is, to me, an acceptable workaround. Still, I don't feel comfortable with this. It feels like I'm missing out on a pretty decent performance bump.
Ideally I'd like to be able to tell Core Data / SQLite to sync the SHM/WAL to the main data file and then perform the backup. Is there a way to do so without digging out crazy private or undocumented APIs ?
To move the WAL data to the database file, open the database file and execute the SQL statement PRAGMA wal_checkpoint(RESTART).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With