db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject [OTM] NPE on OTMConnection.refresh(object)
Date Wed, 19 May 2004 14:40:07 GMT
When refreshing an already persistent object, that also has been retrieved from
db, I get an NPE:

java.lang.NullPointerException
at org.apache.ojb.otm.core.ConcreteEditingContext.
                           refresh(ConcreteEditingContext.java:826)
at org.apache.ojb.otm.core.BaseConnection.
                           refresh(BaseConnection.java:377)
at com.ewerk.erak.db.ojb.otm.
                     LegalcaseDAOImpl.updateLegalcase(LegalcaseDAOImpl.java:132)

In ConcreteEditingContext.refresh()

public void refresh(Identity oid, Object object)
{
    ContextEntry entry = (ContextEntry) _objects.get(oid);
    Object[][] origFields = (Object[][]) _original.get(oid);
    if (origFields != null)
    {
        setFields(entry.userObject, origFields);
        if (object != entry.userObject)
        {
            setFields(object, origFields);
        }
    }
    entry.state = entry.state.refresh();
}

the local variable entry is null. Even worse the HashMap _objects it self is
empty. How can this be possible at all?

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message