Re: Correctly Updating Objects
Re: Correctly Updating Objects
- Subject: Re: Correctly Updating Objects
- From: Chuck Hill <email@hidden>
- Date: Thu, 31 Jul 2003 09:25:13 -0700
- Organization: Global Village Consulting, Inc.
Hi,
Goodbye Bill wrote:
I've created an app that pulls in a large amount of data from an existing
application. Then, I have a page that allows me to tweak one record at a
time. Unfortunately, there are some random instances where changes are not
being saved to the database.
Assuming
1. you are actually making the changes you think you are :-)
2. the object being changed is in an EC
3. you are saving the same EC
4. you are not using nested ECs
Then the most likely reason for this to happen is that you are riling EOF:
http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?wikiPage=EOFCommandments
If you mess up the snapshots with bad coding then EOF can't tell what
is new or what has changed. Chaos will reign in your application, a
plague of locusts will be upon the land.
What is the proper way to save an individual object once it is loaded? I
mean, locking, updating, saving, etc.?
1. Lock the ec if it is not already locked.
2. Fetch the object
3. Update the object
4. Save the EC
5. Unlock the EC
Chuck
--
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.