Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

WAL and SHM files not cleaned up during reset #29

Open
davidogren opened this issue Mar 18, 2014 · 4 comments
Open

WAL and SHM files not cleaned up during reset #29

davidogren opened this issue Mar 18, 2014 · 4 comments

Comments

@davidogren
Copy link

While running unit tests on my SSDataKit enabled project I was hitting some SQLite 522 'not an error' errors. Those unit tests were on iOS7 (which has WAL enabled by default) and the tests frequently run SSManagedObject +resetPersistentStore during setup.

Some Googling and StackExchange searching led me to a theory that this might be caused by WAL mode, and particularly by the inconsistent state caused by having a new sqlite database file created, but still having an old WAL journal. As part of exploring that theory, I modified SSDataKit to clean up those -shm -wal files used by WAL when SSDataKit resets the persistent store or is cleaning up after a failed lightweight migration.

That theory didn't pan out, but I wanted to offer those changes back to you regardless. (I'll send a pull request right after I submit this issue.) Feel free to reject the request if you know that SQLite will always do the right thing with just the sqlite file removed. (Which, in theory, it should be able to do.)

@nitriques
Copy link

Nice find!

@soffes
Copy link
Owner

soffes commented Sep 16, 2014

PR welcome!

@Baitula
Copy link

Baitula commented Apr 24, 2018

And you

@Baitula
Copy link

Baitula commented Apr 24, 2018

And donot

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

No branches or pull requests

4 participants