Louis,
Trying to save a single EO while leaving others unsaved is almost
always indicative of a problem in your application's design. Think of
an EOEditingContext as being somewhat like an SQL transaction, except
that it persists in RAM beyond a single commit. Now, saying that you
need to save a single EO is like saying (in the context of an SQL
transaction) that you want to commit just one of several UPDATEs that
are a part of the transaction; you're working against the grain of
the frameworks. You should probably go back and re-think your design,
so that you are no longer trying to save the single EO -- instead,
your natural flow will be to save the entire state of the object
graph tracked by the EC.
--Paul
Paul Suh
http://www.ps-enable.com/
[EMAIL PROTECTED] (301) 643-1516
On Apr 21, 2006, at 11:32 AM, [EMAIL PROTECTED]
wrote:
Message: 3
Date: Fri, 21 Apr 2006 00:19:51 -0400
From: Louis Demers <[EMAIL PROTECTED]>
Subject: How to selectively save EO
To: WebObjects-List Apple <webobjects-dev@lists.apple.com>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii; format=flowed
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.
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 ?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to archive@mail-archive.com