db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: detachable vs non detachable classes serialization compatible
Date Mon, 07 May 2007 22:48:40 GMT
Hi Erik,

It would help if you could explain what you have in mind with this  
change. The decision to make the detachable serialization contract  
incompatible was deliberate, and the objective is to guarantee that  
attaching a detached instance behaves correctly.

If you want a detached instance simply to send it away and never  
expect to see it again, your proposal might be of interest. Is that  
what you had in mind?

Do you have some ideas on how to implement this feature? Seems that  
if the unenhanced class is given an input stream with the detached  
info in the serialized form of the instance, it's going to run into  
an exception (unless you modify the unenhanced class, perhaps with a  
byte-code enhancer).

Thanks,

Craig

On May 6, 2007, at 5:39 AM, Erik Bengtson wrote:

> Hi,
>
> The spec says classes that detachable and non detachable classes  
> are not
> compatible intentionally. I would like to propose a change to this  
> behavior and
> let the “jdoDetachedState” lose on unmarshalling.
>
> From:
> "Classes marked as Detachable are not serialization-compatible with  
> un-enhanced
> classes. This is intentional, and requires that the enhanced  
> version of the
> class be used wherever the instance might be instantiated."
>
> To:
> "Classes marked as Detachable are not serialization-compatible with  
> un-enhanced
> classes. When unmarshalling a detached object with an un-enhanced  
> version of
> the class, the detached state is dropped and no further read or  
> change tracking
> will occur on the unmarshalled instance."
>
> Regards,
>
> Erik Bengtson

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message