• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can't modify EO objects! ARGH! =(
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't modify EO objects! ARGH! =(


  • Subject: Re: Can't modify EO objects! ARGH! =(
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 17 Jul 2003 15:10:02 -0700
  • Organization: Global Village Consulting, Inc.

You have just been lucky. I've also seen this done in a lot of cases where nothing went wrong for a long time. Then one day things just stopped working right. EOF does not like this and believes that revenge is a dish best enjoyed cold. :-)

The problem you describe can be avoided with nested or peer editing contexts.


Chuck


Albert Jagnow wrote:
I am confused by the pattern you list below.  I have had more problems
doing insert before populate.  For example suppose I have an application
that allows users to enter a list of expenses for reimbursement.  Say
the user has entered 10 expenses, then clicks the link to add another.
They go to a page that has a form and a new Expense EO bound to the form
fields.  The EO has been created but not inserted into the EC. If the
user decides they really did not want to add another expense and leaves
the page things work OK.  However if the Expense EO had been inserted
the next time saveChanges is called, depending on how validation is
done, the save will either fail or insert a blank row because there is
an empty EO out there.  I have never had a problem doing create,
populate, insert, save, as described above.  Have I just been lucky, or
am I not understanding what you are talking about here.  Can someone
elaborate on this issue.

--Albert

-----Original Message-----
From: Chuck Hill [mailto:email@hidden]
Sent: Thursday, July 17, 2003 12:36 PM
To: Goodbye Bill
Cc: WebObjects-Dev
Subject: Re: Can't modify EO objects! ARGH! =(


Goodbye Bill wrote: > default EC. I then create a new "Member" object without > inserting it into the EC. I populate the variables of > the "Member" object, stick it into the EC > Klaxons and red flashing lights go on.

Don't do that!  The pattern is:

1. Create
2. Insert
3. Populate
4. Save

See:
http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?wikiPage=
EOFCommandments


Chuck


Goodbye Bill wrote:

Could someone please tell me why I cannot destroy an object in the

database

once it is loaded into the session?

DETAILS:
I have a two-step signup process for my web site.  Users must create a
"Signup Request" including their name and email address.  A

confirmation

code is then sent their email address. They must return to the site

and

enter this confirmation code before their "Member" object will get

created.

ISSUE:
When the user returns to the site to enter their confirmation code, I

load

the "Signup Request" object into a local object within the session

using the

default EC. I then create a new "Member" object without inserting it

into

the EC. I populate the variables of the "Member" object, stick it

into the

EC, then attempt to save the "Member" object while blowing away the

"Signup

Request" object. I have tried this as two separate commands and

together as

one. The "Member" object always saves fine however I cannot do

anything

with the "Signup Request" object.

ERROR DETAILS FOLLOW:
com.webobjects.eoaccess.EOGeneralAdaptorException:
updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in
database
at



com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextI nfor

mationAdded(EODatabaseContext.java:4658)
   at


com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseConte xt.j

ava:6365)
at



com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingCo ntex

t(EOObjectStoreCoordinator.java:411)
   at


com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.j ava:

3128)
   at Session.SaveNewMember(Session.java:85)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:

http://www.lists.apple.com/mailman/listinfo/webobjects-dev

Do not post admin requests to the list. They will be ignored.





--

Chuck Hill                                 email@hidden
Global Village Consulting Inc.             http://www.global-village.net

Progress is the mother of all problems.
- G. K. Chesterton
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >RE: Can't modify EO objects! ARGH! =( (From: "Albert Jagnow" <email@hidden>)

  • Prev by Date: Re: Need some ideas for a WO file upload app
  • Next by Date: Re: EO Object Lifespan / Editing Context (Goodbye Bill)
  • Previous by thread: RE: Can't modify EO objects! ARGH! =(
  • Next by thread: Re: Can't modify EO objects! ARGH! =(
  • Index(es):
    • Date
    • Thread