db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Re: JDO2 Spec : jdoIsDetached()
Date Sun, 07 Jan 2007 06:15:16 GMT
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

Mime
View raw message