Write-Ahead Logging has been the default journaling mode for Core Data SQLite stores since iOS 7 and OS X Mavericks. Journaling in Core Data is best explained as the way data transactions are saved into the underlying SQLite store. The WAL mode is significantly faster in most scenarios compared to the previous default “rollback” journal mode and is the underlying reason that makes it possible to have concurrency in Core Data.

With the WAL mode, Core Data keeps the main SQLite store file untouched and keeps track of data transactions in a -wal file within the same location of the SQLite store. This means that in some cases, changes are not yet visible in the SQLite store itself. Because of this, you might want to force commit those changes into the SQLite store. In this blog post, I’ll give you both an example and an explanation of how you can do this.

#core-data #swift #programming #ios #mobile

Write-Ahead Logging (WAL) Disabled to Force Commits in Core Data
1.85 GEEK