Two approaches that jump to my mind are: 1. Try to make the contexts match whenever you compare them, e.g. by using sowdri's method. 2. For you context-less collection of objects, get away from EntityProxy equality semantics by wrapping/translating the objects in a class that has the equality semantics that you define.
On Nov 14, 6:25 pm, Hilco Wijbenga <[email protected]> wrote: > On 14 November 2011 12:49, Robert Quinn <[email protected]> wrote: > > > I also have collections of EntityProxys, but I make the lifetime of > > the collection the same as the lifetime of the RequestContext. > > > So after I do a CRUD operation, I refresh my collections in the new > > RequestContext, and therefore don't have any inter-RequestContext > > problems. > > That just doesn't seem feasible, I'm afraid. > > Basically what I do is the following: > 1) request a list of proxies from the database (List<EntityProxy>, "list"); > 2) unrelated, at a later time in another place, new RequestContext for > "entity"; > 3) add one proxy ("proxy") from "list" to a Set<EntityProxy> ("set"); > (this "set" is part of "entity") > 4) RequestContext.fire(); > 5) onSuccess(); > 6) unrelated, at a later time in another place, check that > entity.set.contains(proxy). > > Is this really such a strange scenario? > > Why would EntityProxyCategory.equals() include requestContext()? What > would be the impact of removing that particular check? > > How do I get an EntityProxy to have a NULL RequestContext? -- 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.
