Re: How to selectively save EO
Re: How to selectively save EO
- Subject: Re: How to selectively save EO
- From: Paul Suh <email@hidden>
- Date: Fri, 21 Apr 2006 15:22:14 -0400
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@hidden (301) 643-1516
On Apr 21, 2006, at 11:32 AM, email@hidden
wrote:
Message: 3
Date: Fri, 21 Apr 2006 00:19:51 -0400
From: Louis Demers <email@hidden>
Subject: How to selectively save EO
To: WebObjects-List Apple <email@hidden>
Message-ID: <p06002001c06e0acb8879@[10.0.1.2]>
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden