You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Luciano Resende <lu...@gmail.com> on 2011/01/22 18:19:13 UTC
Strange data corruption, possible databinding issue
I'm developing a service that reads some noSQL data and is exposed
using the REST Binding. The minute i make my interface @remotable, I'm
experiencing data corruption where the entity id is getting modified.
With local interface (OK)
ID stage 1: 4d3b10904a7b224d2fcd73d6
ID stage 2: 4d3b10904a7b224d2fcd73d6
With Remotable interface (ID gets corrupted)
ID stage 1: 4d3b0ff26b9d224dae390d45
ID stage 2: 4d3b0ff36b9d224db1390d45
You can notice that the middle of the id now looks slightly different
in stage2, that is after running trough the invocation chain and get
manipulated by the databinding framework.
Thoughts ? Ideas on what might be going wrong ?
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/
Re: Strange data corruption, possible databinding issue
Posted by Luciano Resende <lu...@gmail.com>.
On Sat, Jan 22, 2011 at 10:10 AM, Raymond Feng <en...@gmail.com> wrote:
> It could be a component state issue. Do you have the getter method invoking
> the id generation? If so, there could be a side effect if the bean is
> serialized (the getter could be invoked)
I'm not generating the ID myself, but relying on the noSQL engine to
do so. My DTO then only "store" the ID which is set via
getters/setters... Also, this is happening on a unit test, which is
really just exercising the service in a pojo/to/pojo fashion, so I
would expect serialization to be minimal or none, at least to the
extent of corrupting the data.
Anyway, further thoughts are welcome, I'll try to debug this further
later today and will provide any information I find on this thread.
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/
Re: Strange data corruption, possible databinding issue
Posted by Raymond Feng <en...@gmail.com>.
It could be a component state issue. Do you have the getter method invoking the id generation? If so, there could be a side effect if the bean is serialized (the getter could be invoked)
Do you generate the id using UUID? It seems that you're getting two IDs.
Thanks,
Raymond
________________________________________________________________
Raymond Feng
rfeng@apache.org
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________
On Jan 22, 2011, at 9:19 AM, Luciano Resende wrote:
> I'm developing a service that reads some noSQL data and is exposed
> using the REST Binding. The minute i make my interface @remotable, I'm
> experiencing data corruption where the entity id is getting modified.
>
> With local interface (OK)
>
> ID stage 1: 4d3b10904a7b224d2fcd73d6
> ID stage 2: 4d3b10904a7b224d2fcd73d6
>
> With Remotable interface (ID gets corrupted)
>
> ID stage 1: 4d3b0ff26b9d224dae390d45
> ID stage 2: 4d3b0ff36b9d224db1390d45
>
> You can notice that the middle of the id now looks slightly different
> in stage2, that is after running trough the invocation chain and get
> manipulated by the databinding framework.
>
> Thoughts ? Ideas on what might be going wrong ?
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/