Date: February 13, 2006 9:27:34 AM PST
Subject: Negative VOTE Issue 103: Embedded instances in detached instances
Javadogs,
Please reply if you have objections.
Here's Andy Jefferson's comments on detached embedded:
The latest spec includes "jdoModifiedFieldList" as a way of tracking changes to detached objects whilst detached, being updated by the jdoSetXXX methods. Well lets take the case of a PC object embedded within another PC object. The
owner PC object is detached, so that detaches the embedded object too since we've declared it in the fetch plan.
The detached embedded PC has no identity of its own being persisted into the table of the owner PC, and so has jdoObjectId as null. When this object is detached calling isDetached() returns false if we base PC.isDetached() solely
on whether it has an id and no StateManager. Is this what we'd want to see ? The owner is clearly detached, but the embedded has no identity of its own ...
I'd expect to still track the changes to its fields using jdoModifiedFieldList, because without that we lose all dirty information. Is this correct ?
Here's the proposed spec update:
<proposed 12.6.8>
Changes made to embedded instances of mutable types including persistence-capable types are tracked by the detached instance if they are replaced or modified. Changes are reflected by marking the detached instance’s field as modified.
</proposed 12.6.8>
Craig Russell
P.S. A good JDO? O, Gasp!