db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Bengtson <e...@jpox.org>
Subject Re: serialize Detachable instance for storage
Date Thu, 23 Mar 2006 18:47:28 GMT
Hi Craig,

> On Mar 17, 2006, at 11:40 AM, Erik Bengtson wrote:
> > Hi,
> >
> > If we serialize a detachable instance for storage, does it have the
> > detach state
> > populated?
> Yes. Regardless of whether it's currently managed or already
> detached, the detached state is part of the serialized state of the
> instance.
> > It is at least a waste of space.
> I don't understand how the detached state is wasted space. It
> contains information that's needed if the instance is in future
> attached to a persistence manager.

Let me ask differently: say a class A { B b; // detachable and serialized="true"

When you store an instance of A with a ref to B, B is serialized with detached
flags, but there is no utility of adding detached flags during serialization of
B because its purpose is to store in the database.  So IMO, we should not add
detached flags in serialized stored instances.

So, it is a waste of space in the database.

View raw message