It does seems that GWT RPC does perserve object graphs properly. I use Twig to persist to the DataStore and that is were my object graph gets messed up. So, new investigations...
Juan, Paul, thanks for your inputs, they led me in the right direction. Carl On Mar 24, 3:15 pm, Paul Robinson <[email protected]> wrote: > GWT RPC does normally preserve object graphs properly, so an instance is only > ever written out once. If the same object is referenced multiple times in an > object graph, the first time it writes out the full object, and subsequent > times it writes a reference back to the thing it wrote out before. > > You need to be careful with circular references held in sets/maps, but it > doesn't sound like this is your > issue:http://code.google.com/p/google-web-toolkit/issues/detail?id=3577 > > Paul > > On 24/03/11 10:35, Carl wrote: > > > > > > > > > Hi, > > I have the following setup: > > > import java.io.Serializable; > > class A implements Serializable { > > Set<B> bs; > > Set<C> cs; > > } > > > class B implements Serializable { > > Set<C> cs; > > } > > > class C implements Serializable { > > Set<B> bs; > > } > > > I send an instance of A from client to server using GWT RPC. After > > deserialization the objects graph is no longer intact. Multiple > > instances of what was earlier one instance have been created and > > referenced to respectively. > > > Example: > > Before serialization: instance x of A.bs == instance x of C.bs. > > After deserialization: instance x of A.bs != instance x of C.bs. > > > As I understand it, this should not happen as the serialization of all > > the above instances is written to the same stream. > > > I know that GWT RPC only implements parts of java.io.Serializable. > > Does this explain this behavior or does anyone have an idea? > > > Thanks, > > Carl -- 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.
