Re: ERXEC.useSharedEditingContext
Re: ERXEC.useSharedEditingContext
- Subject: Re: ERXEC.useSharedEditingContext
- From: Anjo Krank <email@hidden>
- Date: Fri, 22 May 2009 06:26:42 +0200
Not that I'm the expert here, as I never really used the SEC
willingly, but:
- you don't ever fetch into the SEC, you use bindXXX
- if you ever change an object, you create a new EC, set the SEC to
null, localinstance the object and save
- you (maybe) need to watch fot the different locking semantics (read/
write locks)
I don't know what your "CFArticle" consists of, but for me I'd guess
it would be a little heavyweight for an SEC, as one can't have
relations to non-shared objects.
Cheers, Anjo
Am 22.05.2009 um 00:13 schrieb Amedeo Mantica:
my code in Application.java
EOSharedEditingContext sharedContext =
EOSharedEditingContext.defaultSharedEditingContext();
EOFetchSpecification fetchSpec;
fetchSpec = new EOFetchSpecification("CFArticle",null,null);
articlesArray =
sharedContext.objectsWithFetchSpecification(fetchSpec);
in the app when I have to do changes i use localInstanceIn(ec)
It works...
Is correct ?
Amedeo
On 21/mag/09, at 23:53, Dov Rosenberg wrote:
You have to manually do a local instance of any object that was
fetched
using a shared EC otherwise if you try doing an update - bad things
happen.
We have used the shared EC for several years but it definitely has
its share
of gotchas.
Dov
On 5/21/09 4:35 PM, "Mike Schrag" <email@hidden> wrote:
Maybe the property is controlling the setting of the shared editing
context
when you create a new EC like
EOEditingContext ec = new EOEditingContext();
If (project wonder property = false){
Ec.setSharedEditingContext(null);
}
yes .. it is doing this ...
If your app uses the shared editing context you probably aren't
getting it
from the EO's ec - you are getting it from the Application
i thought you could execute a fetch spec using your EC and if you
fetch against a shared entity, it would go to your ec's associated
sec
and fetch into that, then local instance into your ec? i never use
this thing, though, so maybe my conception of that process is wrong.
ms
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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