See comments below:
Louis Demers wrote:
Hi
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.
Good :)
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 ?
This will create a local instance of the object you can use in the new
editing context
EOUtilities.localInstanceOfObject( yourEditingContext(), yourEO);
If you create your new object in a new editing context, then you must
also ensure that all relating objects that you explicitly use/modify are
also in the same editing context. In this case, i am assuming you are
adding an object inthe defaultEditingContext to the relationship of the
object in your new editing context.
Thanks
Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]