Is it safe to delete sqlite's WAL file?

前端 未结 6 883
小蘑菇
小蘑菇 2020-12-08 08:16

I have a strange problem with Core Data in an iOS app where sometimes the WAL file becomes huge (~1GB). It appears there are other people with the problem (e.g. Cor

6条回答
  •  攒了一身酷
    2020-12-08 08:43

    I have been seeing quite a few negative reports on WAL in iOS 7. I have had to disable it on several projects until I have had time to explore the issues more throughly.

    I would not delete the journal file but you could play with the option of vacuuming the SQLite file which will cause SQLite to "consume" the journal file. You can do this by adding the NSSQLiteManualVacuumOption as part of the options when you add the NSPersistentStore to the NSPersistentStoreCoordinator.

    If that ends up being time consuming then I would suggest disabling WAL. I have not seen any ill effects to disabling it (yet).

提交回复
热议问题