• 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: How to selectively save EO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to selectively save EO


  • Subject: Re: How to selectively save EO
  • From: Louis Demers <email@hidden>
  • Date: Mon, 24 Apr 2006 19:03:38 -0400

At 10:27 AM -0700 2006/04/24, Chuck Hill wrote:
Hi Louis,

I'd like to try an add some clarification to the issue(s) being discussed. I think there are a couple of overlapping areas that could benefit from some more examination.

... ( a very good overview)

What people are saying is that it is wrong to try and save _part_ of a version (3). Doing this would be analogous to a database saving only some of the rows in a transaction,

Yes, I'm very sensitive to make sure that any saves in done in a fashion that leaves the data set coherent.


...
What would be wrong is if the user was creating an object, rather than editing one, in the first version and you tried to save a signature referring to it in the second version. This would not work at the database layer either, as you would have a foreign key referring to a non-existent row in another table. Neither EOF nor relational databases allow this sort of inconsistent data.

Yes, the many "use cases" I ran were designed to make sure that was not a possible outcome.



... The defaultEditingContext() in WOSession is a convenience, nothing more. It is just a _default_ version for easy access. Creating more versions is almost always the right thing to do. Personally, I avoid ever editing in the default, and always create a new version (aka peer editing context) whenever data will be changed (created, updated, deleted). This allows you to keep multiple actions from the same user from interacting with each other in undesired ways.

That is a valuable comment. Since my start with WO, I've used the default as if it was priviliedged or using other contexts was bad...



Please note, that when you start to create alternate versions (again, peer editing contexts), _you_ are responsible for locking and unlocking them so that EOF can do its synchronization work at the correct time. Locking and unlocking at the correct time is complex and error prone. I strongly suggest that you use a known working solution such as the MultiECLockManager:


http://wocode.com/cgi-bin/WebObjects/WOCode.woa/2/wa/ShareCodeItem?itemId=301

You will also find a discussion of locking and object graph handling in my Practical WebObjects book if you want to dive in deeper.

Thanks. Already have the book and constantly refer to it. I will certainly review this issue of locking and unlocking which I may have neglected in my current use of this new editing context.



Chuck

--
Coming in late 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro

can't' wait 8-)


--

Louis Demers ing.
email@hidden
_______________________________________________
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: 
 >Re: How to selectively save EO (From: Paul Suh <email@hidden>)
 >Re: How to selectively save EO (From: Louis Demers <email@hidden>)
 >Re: How to selectively save EO (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: multiple submit - possible workaround advice
  • Next by Date: Re: multiple submit - possible workaround advice
  • Previous by thread: Re: How to selectively save EO
  • Next by thread: Re: How to selectively save EO
  • Index(es):
    • Date
    • Thread