• 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: Snapshot problems SOLVED, FOR REAL, NO JOKE
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Snapshot problems SOLVED, FOR REAL, NO JOKE


  • Subject: Re: Snapshot problems SOLVED, FOR REAL, NO JOKE
  • From: Jean Pierre Malrieu <email@hidden>
  • Date: Mon, 23 Apr 2007 19:07:06 +0200

The more I think about it, why would you ever need to use a nested
editing context instead of a component level peer editing context?

Each time you find yourself writting something like:

child_ec.savechanges();
parent_ec.saveChanges();

you could probably have used a peer context instead of a nested context.

But there are cases were you want to do some editing between doing child_ec.savechanges(); and parent_ec.saveChanges();. Then you should use a child (nested) context.

As another example, if you do something like:

EOEditingContext ec1 = new EOEditingContext();
EOEditingContext ec2 = new EOEditingContext();
EntityA a = new EntityA();
ec1.insertObject(a);
EntityA local_a = (EntityA) EOUtilities.localInstanceOfObject(ec2,a);

Then local_a is going to be null, and can't be used.

If you do:

EOEditingContext ec1 = new EOEditingContext();
EOEditingContext ec2 = new EOEditingContext(ec1);
EntityA a = new EntityA();
ec1.insertObject(a);
EntityA local_a = (EntityA) EOUtilities.localInstanceOfObject(ec2,a);

Then local_a can be used...

JPM






_______________________________________________ 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
  • Prev by Date: Re: Snapshot problems
  • Next by Date: Re: valueForBindings
  • Previous by thread: Re: Snapshot problems SOLVED, FOR REAL, NO JOKE
  • Next by thread: Refresh Causes Database Update
  • Index(es):
    • Date
    • Thread