Re: How to selectively save EO
Re: How to selectively save EO
- Subject: Re: How to selectively save EO
- From: Sacha Michel Mallais <email@hidden>
- Date: Fri, 21 Apr 2006 12:35:34 -0700
On Apr 21, 2006, at 11:32 AM, email@hidden
wrote:
I would like to save newly created EO immediately but there could be
other objects in the default EditingContext which I do not want to
commit to the database immediately.
My first attempt was to create a new short term EditignContext,
insert my newly created EO in it and call saveChanges.
However because this object has a relationsip to another one in the
defaultEditingContext, it cause an error about being unable to obtain
globalId
Any suggestions how to acheive this ?
You're doing the right thing by creating it's own EC (Editing
Context), but you have a relationship to an object in another EC.
This is one of the rules that you must never violate, on pain of
ridiculously unhelpful exception messages and a bruised forehead.
Fault the related object into your newly created EC and save, all
will be good.
sacha
--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc. http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"I resist change even as I call for it." -- Mason Cooley
_______________________________________________
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