Re: recovering from EOF exception

Chuck Hill <[email protected]> Tue, 11 Mar 2003 12:55:11 -0800
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
deleteObject() should do what you want.  And I think you told me before why
this was happening to you so I won't even ask.  ;-)


Chuck


At 01:56 PM 11/03/2003 -0600, Jonathan Rochkind wrote:
>Let's say I insertObject a new EO, and then try to saveChanges. Upon 
>saveChanges, I get an exception. Let's say I am able to determine that this 
>is a 'can not insert, duplicate primary key' exception. Let's further say 
>that I know what I want to do to respond to this---I want to just forget 
>about that damn EO, pretend I never inserted it, remove it from the EC 
>entirely, not try to insert it again.
>
>What's the best way to do this?  What I come up with is calling either 
>ec.forgetObject (even though the docs tell me never to invoke this 
>directly, it somehow seems appropriate) or simply ec.deleteObject (recall 
>that this is an object which has NEVER existed in the db; the exception 
>occured trying to insert it).  But it's possible neither of those will be 
>sufficient at this point. Also there are all the invalidate/refault stuff, 
>but that doesn't seem appropriate in this situation with a 
>not-succesfully-inserted object, and besides, I try to avoid 
>invalidate/refault stuff at all costs myself.
>
>Does anyone have any advice?
>
>--Jonathan
>
>_______________________________________________
>EOF mailing list
>[email protected]
>http://www.omnigroup.com/mailman/listinfo/eof
>

--

Chuck Hill                                 [email protected]
Global Village Consulting Inc.             http://www.global-village.net