[Q] SQLite corruption issue[?] and how to avoid[?]
[Q] SQLite corruption issue[?] and how to avoid[?]
- Subject: [Q] SQLite corruption issue[?] and how to avoid[?]
- From: "Jon C. Munson II" <email@hidden>
- Date: Wed, 25 Feb 2009 14:51:02 -0500
- Organization: JTA Enterprises LLC
Namaste!
I have a niggling problem that isn't repeatable, nor consistent, but seems
to occur only when my application starts up. That problem is various SQLite
errors when an attempt is made to get to the database. While I'm not sure
*when* this happens exactly, I'm guessing it happens either in the initial
-persistentStoreCoordinator app delegate method, or when the first fetch is
executed. Since the problem doesn't occur with any frequency nor is
repeatable, I'm not really able to catch it.
Right now my app crashes outright, then it takes several application
restarts to get the database back to usability.
I do know that one possible cause of the problem was a power outage we
experienced last night. While my app wasn't running, I did have to power up
the Mac. When I ran my app, it crashed with a final SQLite3Error. Several
application restarts later I have no trouble using the application.
I did check the Core Data Programming Guide to see if there were any
housekeeping methods I could use, and also did some digging on the 'net (I
did find I.S.' thread on housekeeping from nearly a year ago which discussed
VACUUM and auto_vacuum). However, I wasn't able to find anything leaning
towards what I'd like to do.
So, what I'd like to do is put an initial check in
-persistentStoreCoordinator (or somewhere better) that could verify the
database's file integrity, and if kaboshed, repair it.
If anyone has a way of doing that, I'd appreciate knowing about it.
Many thanks in advance!
Peace, Love, and Light,
/s/ Jon C. Munson II
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden