Consequences of -wal file disappearing in SQLite?
The file format documentation mentions a "hot WAL file", but this applies only to uncommitted data.
The database file itself does not contain any information about committed data in the -wal
file, i.e., transactions before a checkpoint typically do not alter the main database file at all.
Therefore, deleting the -wal
file will simply restore the database to the state it was after the last checkpoint (which is outdated, but consistent); all transactions committed later will just be lost.
What could be preventing SQLite WAL files from being cleared?
I temporarily switched to journal mode, which helpfully reported errors instead of silently failing.
The error I was having was SQLITE_IOERR_WRITE. After more digging, it turned out the root Windows error causing all this was 665 - hitting into an NTFS file system limitation. An answer here then led me to the actual cause: extreme file fragmentation of the database.
Copying the file reduces fragmentation, which is why the bizarre fix I mentioned, copying the file, temporarily worked. The actual fix was to schedule defragmentation using Sysinternals' Contig.
Is it okay or safe to delete debug_kit.sqlite file
You can delete it. If you set your debug to false than files will not be generated anymore
Can a Core Data .sqlite backup without a WAL file be restored to operate in WAL mode?
You can change the journal mode of a database at any time, as long as you have exclusive access; just open it, and execute the PRAGMA. (In fact, this is the only method to enable WAL mode.)
Please note that only WAL mode is persistently stored in the database file; any other journal mode is a property of the connection; when a non-file WAL is opened, it is in DELETE mode by default.
Related Topics
Lock iOS App in Single App Mode Programmatically
Peripheral and Central at the Same Time on iOS
Opens Apple Maps App from iOS App with Directions
Move Xcode Project Causes Red Text (Missing Files from Project)
Communicating With/Opening Containing App from Share Extension
Detect Tap on Calloutbubble in Mkannotationview
Link Errors with Parse.Framework iOS
Difference Between Completion Handler and Blocks:[Ios]
Xcode 7 UI Testing: Dismiss Push and Location Alerts
Detect Moment When Newline Starts in Uitextview
How to Set Status Bar Tint Color on iOS 6
Xcode 6.4/7 Crashing After El Capitan Beta
How to Pass Data to Another Controller on Dismiss Viewcontroller
Change Uifont in Secure Uitextfield Strange Behaviour in iOS7