Re: You crossed editing context boundaries...
Re: You crossed editing context boundaries...
- Subject: Re: You crossed editing context boundaries...
- From: David LeBer <email@hidden>
- Date: Tue, 14 Oct 2008 18:08:17 -0400
On 14-Oct-08, at 5:34 PM, WebObjects wrote:
On Oct 14, 2008, at 4:13 PM, Clark Mueller wrote:
You need to get a local copy of the object in the editing context
where you are trying to make the relationship. Have a look at
EOUtilities.localInstanceOfObject(ec, object).
So even if I sent the EO from one component to another I should get
a local copy of it?
I have
EOEditingContext editingContext = ERXEC.newEditingContext();
I checked the EOUtilities.localInstanceOfObject(editingContext, emp);
I used also the ERXUtilities.localInstanceOfObject(editingContext,
emp);
and then tried again
emp.addObjectsToBothSidesOfRelationshipWithKey(selectedItems(),
Employee.TURNS_KEY);
and still Im getting the same error, what Im doing wrong?
You need to give us more code than that Gus, otherwise you're setting
up a game of 20 questions and no one is gonna play.
How are you getting the array of all Turns? They need to be in the
same editingContext as the emp.
Gus
Clark
On Oct 14, 2008, at 2:09 PM, WebObjects wrote:
Hello, Im trying to use this method :
addObjectsToBothSidesOfRelationshipWithKey(NSArray obj1, String
arg1)
or something like that.
What I have is my Employee and the turns that tis particular
Employee selected. I dunno if I should use the method above or the
other one with the same name, but with other arguments,
(EORleationShipManipulation eo, String arg1).
Anyway, I tried both but I get this error
Error:
java.lang.RuntimeException: You crossed editing context boundaries
attempting to set the 'turns' relationship of (in EC
er.extensions.eof.ERXEC@15e6f8) to (in EC
er.extensions.eof.ERXEC@905335).
Reason:
You crossed editing context boundaries attempting to set the
'turns' relationship of <controlHorarios.app.eo.Employee pk:"1">
(in EC er.extensions.eof.ERXEC@15e6f8) to
<controlHorarios.app.eo.Turn pk:"1"> (in EC
er.extensions.eof.ERXEC@905335).
I guess Im trying to add to emp the turns which are in different
EC, no? what can I do?
The emp I fetch it using a custom EC ERXC.newEditingContext, and
this emp, I sent it to the other component where I can select the
desired turns. (if this info helps)
regards
Gus
_______________________________________________
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
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
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