Re: Serialization errors

[email protected] Thu, 29 Jan 2009 10:13:01 +1000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
Hello Carl,

I did not write the serialization part.  Looks like it needs a bit more thought.  

The page you refer to is rather unintelligible, but the idea that the objects are fully instantiated before the replacement is a bit scary.  There is lots of opportunity for problems.

I strongly suspect that we should be using the (new?) Externalizable interface.

There should ideally also be some test to make sure that the user classes are actually the same as the non-deserialized one etc.

I think that Franck and others use it.  So it at least basically works.  

There is a test case in LongTransactionTest, but it is within the same JVM.  You must be doing something a bit unusual to produce the bug.  As a first step can you please create a simple test case that reproduces the problem and send it to me.

This requires some thought and investigation.  Sadly I am busy at the moment.  Maybe Franck can have a look?

Anthony


At 01:32 AM 23/01/2009, you wrote:

>Hello, 
>
>I'm getting errors trying to deserialize some SimpleORM objects. (using serialization is necessary due to the the way I am integrating SimpleORM with Wicket) 
>
>It seems that SRecordMeta uses readResolve() to treat itself as a singleton, but I don't think that you can do this if the object graph that you're serializing contains the record meta (such as if you're serializing a SFieldMeta), because of the wording here: http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/input.doc6.html (the "Note" section in particular). 
>
>The error I'm getting is:
>java.lang.NullPointerException 
>
>at simpleorm.dataset.SRecordMeta.getField(SRecordMeta.java:246) 
>
>at simpleorm.dataset.SFieldMeta.readResolve(SFieldMeta.java:186) 
>
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
>
>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>at java.lang.reflect.Method.invoke(Method.java:585) 
>
>at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1033) 
>
>at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1728) 
>
>...etc 
>
>Any help is appreciated, 
>
>Thanks,
>Carl Gould
>Inductive Automation
>[email protected]
>1.800.266.7798 
> 


Spreadsheet Detective,
Southern Cross Software Queensland Pty Limited
54 Gerler Street
Bardon, Queensland 4065, Australia.

Email: [email protected]
www.SpreadsheetDetective.com
Ph: +61 427 830248 (Australian Eastern Standard Time)

"If the model seems correct only because the numbers look right, 
then why build the model in the first place?"

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
19c4eef7.jpg (image/jpeg, 3.3 KB) - not displayed