Implementing the setSurveyPermissions method as you suggested seems to
have helped a bit.  However, I'm still a bit confused as to what the
client-side behavior I'm seeing should be.

As I mentioned, I retrieve and then send an object, and don't make any
modifications to the object on the client.  But when I look at the
operations in SimpleRequestProcessor.processOperationMessages, I see
the following as the result of the call to req.getOperations.
Basically, this looks like every object referenced by the Survey proxy
object is being sent over the network and some of them are marked as
needing update.  Am I right in that interpretation?

If so, I'm not sure why this is happening.  Does the client keep track
of method calls to determine what needs to be updated, or something
else?

Ryan

{"T":"edu.hope.cs.surveys.dao.ISurveyInfo","V":"MC4w","P":{"tags":
[{"T":"edu.hope.cs.surveys.dao.ITag","S":"IjIi"},
{"T":"edu.hope.cs.surveys.dao.ITag","S":"IjEi"}],"surveyPermissions":
[{"T":"edu.hope.cs.surveys.dao.ISurveyPermission","S":"IjMyODki"},
{"T":"edu.hope.cs.surveys.dao.ISurveyPermission","S":"IjMyODgi"},
{"T":"edu.hope.cs.surveys.dao.ISurveyPermission","S":"IjMyOTAi"}],"completionRoutines":
[{"T":"edu.hope.cs.surveys.completion.client.ICompletionRoutine","S":"Ijci"},
{"T":"edu.hope.cs.surveys.completion.client.ICompletionRoutine","S":"Ijgi"}],"thisSurveysQuestions":
[{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","S":"IjEi"},
{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","S":"IjIi"},
{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","S":"IjMi"},
{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","S":"IjQi"}],"authenticationRoutine":
{"T":"edu.hope.cs.surveys.authentication.client.IAuthenticationRoutine","S":"IjIi"},"eligibilityRoutine":
{"T":"edu.hope.cs.surveys.eligibility.client.IEligibilityRoutine","S":"IjUi"}},"S":"IjEi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.authentication.client.IAuthenticationRoutine","V":"MC4w","S":"IjIi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.eligibility.client.IEligibilityRoutine","V":"MC4w","P":
{"parameterDescriptions":
[{"T":"edu.hope.cs.surveys.dao.IRoutineParameterDescription","S":"IjEi"},
{"T":"edu.hope.cs.surveys.dao.IRoutineParameterDescription","S":"IjIi"}]},"S":"IjUi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.IRoutineParameterDescription","V":"MC4w","S":"IjEi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.IRoutineParameterDescription","V":"MC4w","S":"IjIi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.completion.client.ICompletionRoutine","V":"MC4w","S":"Ijci","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.completion.client.ICompletionRoutine","V":"MC4w","S":"Ijgi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","V":"MC4w","P":
{"thisQuestionsChoices":
[{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","S":"IjEi"}],"choiceGroup":
{"T":"edu.hope.cs.surveys.dao.ChoiceGroupProxy","S":"IjEi"}},"S":"IjEi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceGroupProxy","V":"MC4w","P":
{"choices":
[{"T":"edu.hope.cs.surveys.dao.pojo.ChoiceGroupItemProxy","S":"IjEi"},
{"T":"edu.hope.cs.surveys.dao.pojo.ChoiceGroupItemProxy","S":"IjIi"}]},"S":"IjEi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.pojo.ChoiceGroupItemProxy","V":"MC4w","P":
{"choice":
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","S":"IjEi"}},"S":"IjEi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","V":"MC4w","S":"IjEi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.pojo.ChoiceGroupItemProxy","V":"MC4w","P":
{"choice":
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","S":"IjIi"}},"S":"IjIi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","V":"MC4w","S":"IjIi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","V":"MC4w","P":
{"choice":
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","S":"IjEyIg=="}},"S":"IjEi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","V":"MC4w","S":"IjEyIg==","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","V":"MC4w","P":
{"thisQuestionsChoices":
[{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","S":"IjIi"},
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","S":"IjMi"},
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","S":"IjQi"},
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","S":"IjUi"}]},"S":"IjIi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","V":"MC4w","P":
{"choice":
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","S":"IjMi"}},"S":"IjIi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","V":"MC4w","S":"IjMi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","V":"MC4w","P":
{"choice":
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","S":"IjQi"}},"S":"IjMi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","V":"MC4w","S":"IjQi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","V":"MC4w","P":
{"choice":
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","S":"IjUi"}},"S":"IjQi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","V":"MC4w","S":"IjUi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.SurveyChoiceProxy","V":"MC4w","P":
{"choice":
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","S":"IjYi"}},"S":"IjUi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ChoiceProxy","V":"MC4w","S":"IjYi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","V":"MC4w","S":"IjMi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ISurveyQuestion","V":"MC4w","S":"IjQi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ISurveyPermission","V":"MC4w","S":"IjMyODki","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ISurveyPermission","V":"MC4w","S":"IjMyODgi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ISurveyPermission","V":"MC4w","S":"IjMyOTAi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ITag","V":"MC4w","S":"IjIi","O":"UPDATE"}
{"T":"edu.hope.cs.surveys.dao.ITag","V":"MC4w","S":"IjEi","O":"UPDATE"}


On Jun 20, 2:42 pm, Ryan McFall <[email protected]> wrote:
> I'm trying your suggestion on the setter at the moment; I'm a little
> nervous about this due to the volume of posts on the web which make it
> sound like trying to do anything intelligent in the setter can lead to
> the error I encountered.  But your logic makes sense, so it may work.
> All my server-side unit tests pass with this in place, so that's at
> least optimistic.
>
> I looked at the bug you referenced, which seems possibly to be the
> source of the problem.  I don't have a many-to-many collection, but
> the problem with .equals versus .deepEquals seems like it would exist
> whether the collection was many-to-many or one-to-many.
>
> Thanks again for the thoughts - it's great having someone respond so
> quickly!
> Ryan
>
> On Jun 20, 2:01 pm, Thomas Broyer <[email protected]> wrote:
>
> > On Monday, June 20, 2011 7:44:56 PM UTC+2, Ryan McFall wrote:
>
> > > I haven't changed the collection, and SurveyProxy is an EntityProxy,
> > > not a value proxy.  Here's the code from SimpleRequestProcessor that
> > > handles this:
> > > public boolean visitReferenceProperty(String propertyName, AutoBean<?>
> > > value, PropertyContext ctx) {
> > >   // containsKey to distinguish null from unknown
> > >   if (flatValueMap.containsKey(propertyName)) {
> > >     Class<?> elementType = ctx instanceof CollectionPropertyContext ?
> > > ((CollectionPropertyContext) ctx).getElementType() : null;
> > >     Object newValue = EntityCodex.decode(state, ctx.getType(),
> > > elementType, flatValueMap.get(propertyName));
> > >     Object resolved = state.getResolver().resolveDomainValue
> > > (newValue, false);
> > >     service.setProperty(domain, propertyName,
> > > service.resolveDomainClass(ctx.getType()), resolved);
> > >   }
> > >   return false;
> > > }
>
> > > There's nothing here that checks whether the collection has been
> > > changed.  So unless this is supposed to happen on the client side (so
> > > that the survey permissions object doesn't exist in the payload at
> > > all, and therefore doesn't get visited), I don't see any way for this
> > > to happen.  Should client side code be handling this?
>
> > Absolutely! That's one of the features of RequestFactory to only send diffs
> > from client to server.
>
> > > I can debug
> > > through there and try to figure out what's happening if need be.
>
> > It might behttp://code.google.com/p/google-web-toolkit/issues/detail?id=5952
>
> > But I still believe you should (independently of RequestFactory) rewrite
> > your setter, otherwise the issue will surface later as some other code will
> > call it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to