Re: What's a good way to handle orders?
Re: What's a good way to handle orders?
- Subject: Re: What's a good way to handle orders?
- From: Guido Neitzer <email@hidden>
- Date: Sun, 6 Jan 2008 20:25:44 -0700
On 06.01.2008, at 19:38, Kevin Windham wrote:
The way I understand it, the order may not be in the DB, but it does
interact with the other objects that are since it is part of the
object graph in memory. One case I saw was looking at order history.
The order wasn't in the DB, but when you go look at the order
history you can see the bogus order there. There are other things
that might be affected, the problem for me with going that route is
I don't know how exactly it works under the hood. I'm just worried
there would be other side effects that I don't know about.
Use a different editingContext then the defaultEditingContext of the
session for your order, as you should always do. Make all your changes
there and save it only at the end.
If your user stops the checkout process implicitly, you can call
editingContext.revert() and then just discard it. Or you can leave it
hanging around. As long as you don't call saveChanges, nothing gets
pushed to the other editingContexts.
You can look at an editingContext as a sandbox where you can play in
until you have things in a state you want - if you want to tell the
rest of the application about the changes, save them. If not, just
discard that editingContext and you're done.
You can read more about that here:
http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/Managing/chapter_7_section_1.html
cug
--
http://www.event-s.net
_______________________________________________
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