• 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: Nested Editing Contexts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nested Editing Contexts


  • Subject: Re: Nested Editing Contexts
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 30 May 2007 11:47:57 -0700


On May 30, 2007, at 11:41 AM, Ted Archibald wrote:

Originally in my program I was using the defaultEC to create and insert new objects, but then started to notice I had alot of null objects in my DB. Users are creating an object, then doing nothing with it, then it is committed to the DB when the defaultEC is saved at some later point.

That is why the defaultEC is best reserved for read only data.


Is this what I'm suppose to be doing to create a nested EC?:
EOEditingContext ec = new EOEditingContext(defaultEC);

Unless you have a specific need for a nested EC, this is what I use 99% of the time:


EOEditingContext ec = new EOEditingContext();


Am I suppose to do any sort of locking and so forth? Should I be using ERXEC?

No. There is absolutely no need to lock the editing contexts as long as you enjoy bizarre and unpredictable bugs. :-P Otherwise, locking is mandatory.


http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ Context_and_Database_Locking


Chuck


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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


References: 
 >Nested Editing Contexts (From: "Ted Archibald" <email@hidden>)

  • Prev by Date: Nested Editing Contexts
  • Next by Date: Re: Nested Editing Contexts
  • Previous by thread: Nested Editing Contexts
  • Next by thread: Re: Nested Editing Contexts
  • Index(es):
    • Date
    • Thread