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.

Reply via email to