Re: serialising SimpleORM classes?

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

It seems to be related to this issue in the Sun Bug Tracker.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6208166

What happens is this sequence:
ObjectInputStream.readObject()
   .. starts reading SQueryResult
   ...partially constructs my SRecordInstance subclass
   ...starts trying to deserialise the SDataSet field in SRecordInstance
   --> calls LinkedHashMap.readObject
     --> calls LinkedHashMap.putForCreate
       --> calls hashCode() on my partially constructed SRecordInstance subclass
             which throws a NullPointerException

Not sure how to solve this yet.

Regards, Noel.

Noel Grandin wrote:
> You're right, that wasn't the problem. It is something rather strange.
>
> If I serialise and de-serialise the SDataSet, everything is fine.
> But if I serialise and de-serialise the SQueryResult, the SRecordInstance objects contain no data.
>
> Weird.
>
> John Abraham wrote:
>>  
>> I thought serialization just checked to make sure the serialVersionUID matched?  In which case if you are using the
>> same version of the SimpleORM software on both machines, it should work.
>>
>> I might be rusty on my serialization though.
>>
>> --
>> John 
>>
>> On 2010-11-08, at 7:23 AM, Noel Grandin wrote:
>>
>>>  
>>>
>>> Hi
>>>
>>> I'm trying to send some SRecordInstance objects across a network link using serialisation, but it's not working.
>>> I suspect the problem is that the SimpleORM classes do not have proper serialVersionUID fields.
>>> The classes should either not declare serialVersionUID at all, or they should have values generated using the
>>> serialver tool.
>>>
>>> Regards, Noel Grandin
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------------------------------------------------
>>> Disclaimer: http://www.peralex.com/disclaimer.html
>>>
>>>
>>
>> -- 
>> John Abraham
>> [email protected] <mailto:[email protected]>
>>
>>
>>
>> 

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