Re: EOUtilities.LocalInstanceOfObject performance problem??
Re: EOUtilities.LocalInstanceOfObject performance problem??
- Subject: Re: EOUtilities.LocalInstanceOfObject performance problem??
- From: Dov Rosenberg <email@hidden>
- Date: Wed, 13 Aug 2008 22:25:34 -0400
- Thread-topic: EOUtilities.LocalInstanceOfObject performance problem??
Hmmm - For example
Object A has a relationship to an NSArray of Object B's
In EC1 we retrieve A and access the relationship to the B's and get some of
the properties of the B's.
In EC2 we get a local instance of A and then access the same relationship to
the B's.
Does this local instance of A (in EC2) also give us a local instance of the
B's or does it cause us to refetch the B's into EC2?
In our case we create a new EC because we use a SharedEC for read only data.
When we need to modify an object we create a new EC and set the reference to
the SharedEC to null and rely on the Object Store Coordinator to notify the
SharedEC when the change is committed. We need objects from the SharedEC so
we use LocalInstance to get one. In most cases the SharedEC objects that we
get the local instance of have relationships to objects that have already
been retrieved into the SharedEC.
Thanks in advance
Dov
On 8/13/08 10:12 PM, "Chuck Hill" <email@hidden> wrote:
>
> On Aug 13, 2008, at 6:42 PM, Dov Rosenberg wrote:
>
>> Our code uses EOUtilities.LocalInstanceOfObject() on occasion.
>> Lately I have been seeing some strange slowdowns and the areas the
>> tend to show up in the thread dumps usually have this call near them.
>>
>> The objects that we are getting a localInstance of also have
>> relationships that get accessed. Does the localInstance of an object
>> also get a localinstance of the relationship objects?
>
> No, the related objects are faults that need to be fired.
>
>
>> Is there a performance hit for using this mechanism?
>
> No, it just returns a fault based on the EOGlobalID. Very fast and
> light.
>
>
>
>> We have fixed other similar issues by just refetching the objects
>> into a new EditingContext instead of using localInstance.
>
> I would expect that to be far, far slower.
>
>
>> Does LocalInstance scale under load properly?
>
> There is nothing to scale.
>
> Log the SQL and check that. You might be localInstancing into an EC
> that is set to require new data. This can result in an lot of single
> object trips to the database. But that is a data freshness issue, not
> a localInstance concern.
>
> Chuck
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden