Re: multiple objects in an EO, how to saveChanges() on only one
Re: multiple objects in an EO, how to saveChanges() on only one
- Subject: Re: multiple objects in an EO, how to saveChanges() on only one
- From: Dev WO <email@hidden>
- Date: Sat, 15 Oct 2005 23:59:01 +0200
Hi Ken,
pretty fast answer:)
ok, to summarize, I have different type of action:
-posting a comment on a "news"
-selecting product for a shopping cart
What I was doing was to add both 2 objects (cartItem and commentItem)
into an eo (the defaulteditingContext).
But I'd like the logged user to be able to post a comment even if he
has a cart with some items (I mean he's still doing his shopping at
the time of the comment).
So my cartItem object can't be "saved" because it still missing some
information to complete the order (the order can be incomplete in
fact), but actually if the user try to post a comment, I got an
exception because of the incomplete cartItem.
So I should create another eo for handle these tasks separately?
Can it be 2 default EditingContext?
Should/can I initialize them in the session so they will both be
accessible from different WOComponent?
:)
Xavier
You can't. Can you enlighten the list as to why you want to do this?
The proper thing to do is to have more than one editing context.
Ken
On Oct 15, 2005, at 5:46 PM, Dev WO wrote:
Hi list,
I have different object in the editing context, lets say a, b and c.
I need to save changes to the database only for b (for example;)).
I though b().editingContext().saveChanges() would do the trick,
but it also tries to save all other object...
Anyone with a clue on how to handle this?
Thanks a lot
Xavier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com
This email sent to 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