Hi Andy,

I think what I put into the spec as a sample was before the experts agreed on a detached state field. The implementation that you propose, using the jdoStateManager and jdoDetachedState works, and I can update the spec if no one sees any issues. In fact, we should file a JIRA to make sure that this gets fixed.

Remember that the sample code in Chapter 21 is not normative, although it should at least be correct (which in its current state it is not)...

Thanks,

Craig

On Jan 6, 2007, at 10:15 PM, Andy Jefferson wrote:

Hi Craig,

I haven't looked closely at this, but the spec says that this is a
sample implementation:

public final boolean jdoIsDetached(){
return jdoStateManager==null?false:
jdoStateManager.isDetached(this);
}

Well that sample doesn't work for me since it assumes that a StateManager exists when detached. In JPOX we don't have a "detached StateManager" ... jdoStateManager is null when detached, since we have jdoDetachedState. When detached the jdoDetachedState is updated with any dirty updates (no need for
any StateManager). Consequently we were expecting to be able to use

public final boolean jdoIsDetached()
{
    if (jdoStateManager == null)
    {
        if (jdoDetachedState == null)
            return false;
        return true;
    }
    return false;
}


If an implementation is expected to have a StateManager present when detached why exactly do we have jdoDetachedState? The info could be stored in the
StateManager.


Thanks
--
Andy

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to