On 30-May-07, at 7:20 AM, Frederic JECKER wrote:

Hi,

In my case, I can't insert objects in the editing context at their creation but only at the end of the transaction because the user
can cancel his action at any time.
Doing as decribed works (I do it myself) but if I do so, I will need to call at editingContext.revert() to prevent unwanted changes to be saved in the database by another part of my app using the same context.

To sum up, I'm just looking for a method like EOEditingContext.awakeFromInsert except that it would be called before inserting objects instead of after. This way I could insert relationship members in the editingContext for each EOCustomObject in their own classes and avoid huge code blocks of insert
in my main controller

Frederic,

You need to rethink your apps structure as this *will* lead to trouble and it breaks the EOF commandments. <http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ The_EOF_Commandments>

Don't bother arguing that it works for you :-), we've been down this path many times, check the list archives.

The correct solution is to create a peer or child EOEditingContext to wrap a potentially disposable action so your users can walk away without penalty and *always* insert your EOs right away.

--
;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
--
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to