GWT-RPC serialize objets graphs by POST and isn't do exact JVM
serialization. You must implement equals and hashcode and then if you
compare with equals then:

Before serialization: instance x of A.bs equals instance x of C.bs.
After deserialization: instance x of A.bs equals instance x of C.bs.

2011/3/24 Carl <c...@rahmstrom.com>

> 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 google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

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

Reply via email to