CoreData: Preventing fault firing
CoreData: Preventing fault firing
- Subject: CoreData: Preventing fault firing
- From: Brad Miller <email@hidden>
- Date: Mon, 23 Jul 2007 21:17:42 -0700
Hi,
Is there anyway to prevent an object from firing faults? I've run
into a fairly big slowdown in my app due to relationships being
fetched that don't need to be. In my case I have a background
operation that fetches a group of objects, sets an int value in them,
and then terminates. When I set the value, the 4 many-to-many
relationships that the object has are each being fired in separate
sql queries which according to the sql logging adds about .0016 sec.
The operation could be over a few thousand objects, so that time adds
up quick.
The function that's running looks like (pseudo code here to keep it
short):
- (void)updateObjects
{
NSArray *objects = results from a fetch request
foreach(object in objects)
[object setValue:[NSNumber numberWithInt:1] forKey:@"theKey"];
}
I've confirmed that the faults are being fired when the serValue is
executed by adding logging around the call. There is no UI for the
operation that might be triggering them either.
Thanks,
Brad
_______________________________________________
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