RE: Core data save error with multiple persistent stores [SOLVED]

2008-11-19 Thread Arthur C.
A solution is to have 2 persistentStoreCoordinators and 2 managedObjectContexts, with the Coordinators each having one single persistent store. It is clear that there can be no reassignment problems anymore. However, I don't understand why this seems to be required; that is, why can't I have two m

RE: Core data save error with multiple persistent stores

2008-11-17 Thread Arthur C .
>>It might also be worth putting a test in awakeFromInsert -- first >>check if the object has been assigned to a persistent store, and only >>assign if it has not.>Done that; it doesn't get called more than once, and it >>doesn't help to do >the assignObject: toPersistentStore: outside the >

RE: Core data save error with multiple persistent stores

2008-11-17 Thread Arthur C .
> All right, but that does not cover the case of an object being added > using > the 'add' button linked to the array controller (which btw is > bound to the > correct managedObjectContext). Then you end up directly > in > awakeFromInsert, which at least should be OK if it is executed > onl

Re: Core data save error with multiple persistent stores

2008-11-16 Thread Quincey Morris
On Nov 16, 2008, at 13:30, Arthur C. wrote: The example in the documentation:> http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdCreateMOs.html#/ >/apple_ref/doc/uid/TP40001654-SW2>>does the assignment immediately after the >"insertNewObjectForEntityForName" call

RE: Core data save error with multiple persistent stores

2008-11-16 Thread Arthur C .
From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Core data save error with multiple persistent storesDate: Sun, 16 Nov 2008 21:02:37 +0100 In my application I have two managed object contexts, as I need to be able to save two subsets of my Core Data setup separately. These are both using one and

Re: Core data save error with multiple persistent stores

2008-11-16 Thread Quincey Morris
On Nov 16, 2008, at 12:02, Arthur C. wrote: I take care that every object instance gets inserted into the right managedObjectContext, by using [NSEntityDescription insertNewObjectForEntityForName: ...]. And it gets assigned to the right persistent store by using - (void) awakeFromInsert {

Core data save error with multiple persistent stores

2008-11-16 Thread Arthur C .
In my application I have two managed object contexts, as I need to be able to save two subsets of my Core Data setup separately. These are both using one and the same persistent store coordinator; the coordinator has two stores. I take care that every object instance gets inserted into the r