0

I've read many threads about sqlite database and how to update with wal and checkpoint but I really do not understand despite all the information on Internet.

I merge two sqlite databases on a Desktop computer with a Python script but when I put the new file (store.data) back to the folder in Xcode and replace the old one the app crashes at running (error 259). I think this happens because the original wal/shm file does not recognize the new database (which has now new information/columns/rows) but I cannot figure out how I can create new wal/shm from this file. Or should I modify those ones at the same time I merge databases?

EDIT: it works fine when I execute the PRAGMA wal_checkpoint(RESTART) in sqlite browser app... I replace the old files in my Xcode folder but it only works if I make a new rebuild and not if I just open it in the simulator... This will not cause a problem on a real device since I will not rebuild the app but just launch it? Is there a way to get round of it?

Trichophyton
  • 625
  • 5
  • 21
  • Neither the `-wal` nor the `-shm` files should exist if you correctly close the database. – Colonel Thirty Two Sep 06 '14 at 14:45
  • It looks like the -wal and -shm files are still there when I look at my iOS folder even if Xcode and my app are not running... Should I close the database in my app in a specific way? I do not do more than saving a context before finshing running the app... – Trichophyton Sep 07 '14 at 07:16

0 Answers0