Re: [patch] fix for de-serialisation issue with SQueryResult [1 Attachment]

Noel Grandin <[email protected]> Tue, 09 Nov 2010 14:19:31 +0200
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
Hi

Franck Routier wrote:
>  
>
> Noël, I've commited your patch, that seems to be inspired by the
> workaround mentionned in sun's bug report.
>
> However I'm not sure I understand the out.writeObject(sDataSet); part.
> Can you explain this ?
>
Because I've made the sDataSet field transient, the class needs to handle writing and reading that field itself. This
works around the problem because it forces the ObjectInputStream to initialise the rest of the object's fields before it
tries to initialise the sDataSet field.
>
> Also, our current tests did not trigger the bug, so either we are
> missing some tests on serialization, or this bug is limited to only some
> JVM implementations (I personaly mainly use OpenJDK6).
> Do the tests break for you without your patch, or do you have an idea of
> a better test ?
>
I'm attaching a patch with a new test that can trigger this problem.

Regards, Noel.

Disclaimer: http://www.peralex.com/disclaimer.html