[SOLVED] Re: NSPersistentStoreCoordinator Wars Episode I: The Phantom Lock Menace
[SOLVED] Re: NSPersistentStoreCoordinator Wars Episode I: The Phantom Lock Menace
- Subject: [SOLVED] Re: NSPersistentStoreCoordinator Wars Episode I: The Phantom Lock Menace
- From: Nick Zitzmann <email@hidden>
- Date: Sun, 11 Jan 2009 17:14:13 -0700
On Jan 8, 2009, at 10:43 PM, Ben Trumbull wrote:
Why aren't you using a separate MOC for the main thread and the
NSOperation ?
Because I'm used to programming for other databases (MySQL, OpenBase,
ODBC, etc.) where locking and unlocking the main database connection
as needed was "good enough".
So last Friday through this weekend, I've restructured my code so that
each thread gets its own MOC. After I did that, the deadlock issue
went away, so it was probably something I was doing all along.
Lesson learned: From now on, when I work on a multi-threaded database
application, I'll create one MOC (CoreData) or database connection
(other databases) per thread. Thanks to Ben and Miguel for their help.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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