Re: CoreData: Preventing fault firing
Re: CoreData: Preventing fault firing
- Subject: Re: CoreData: Preventing fault firing
- From: Chris Ridd <email@hidden>
- Date: Tue, 24 Jul 2007 07:18:36 +0100
- Thread-topic: CoreData: Preventing fault firing
On 24/7/07 5:17, "Brad Miller" <email@hidden> wrote:
> 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.
The top hit returned by searching developer.apple.com for "core data bulk"
looks potentially useful:
<http://developer.apple.com/documentation/Cocoa/Conceptual/ModelObjects/Arti
cles/moIntegrating.html>
Cheers,
Chris
_______________________________________________
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