Re: Editing context not reflecting edits?
Re: Editing context not reflecting edits?
- Subject: Re: Editing context not reflecting edits?
- From: Chuck Hill <email@hidden>
- Date: Mon, 27 Sep 2004 21:22:23 -0700
Are you using addObjectToBothSidesOfRelationshipWithKey to make the
User / Group membership relation? If not that is your problem.
Otherwise, I'd check the model. Something is amiss.
Chuck
On Sep 27, 2004, at 4:19 PM, Benjamin Adair wrote:
Woo, two messages in a day. I can't get enough of you all. :)
So, I worked around my PK as attribute deal but stumbled upon
something else that really has stumped me.
In one component, the user editor, the user adds a group membership
and saves. My component gets the default editing context from the
session and tells it to save the changes. (I watch the database log
and see that correlation table between users and groups does in fact
get an insert.) Next the user clicks on the link to go to the group
editor, within which I use the same default editing context method via
the session to retrieve the list of groups. Except here, I'm not
seeing that user that was just added to the group.
When the save button is hit the changes are automagically taken from
the request and saved thusly:
// Save the changes made in the editing context to the database
session().defaultEditingContext().saveChanges();
and then later, in the groups component I use this to generate the
list of groups:
// Build the fetch specification to fetch the complete list of web
groups
groupsFetchSpec = new EOFetchSpecification( "WebGroup", null,
sorting );
...
return
session().defaultEditingContext().objectsWithFetchSpecification(
groupsFetchSpec );
Thoughts? Why, when I make an edit to a group, will I see that edit
reflected in the user component, yet not the other way around? My
relationships (flattened through the many to many) are exactly the
same, option-wise.
Thank you muchly,
Ben
--
Benjamin Adair
Central Office Database Programmer/Analyst
Cancer & Leukemia Group B
Phone: 773-702-6731
Fax: 312-345-0117
Email: email@hidden
Web: http://www.calgb.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development 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