Problems adding a child and deleting it again.

From: Øyvind Harboe (oyvind.harbo..ylin.com)
Date: Tue Dec 05 2006 - 16:54:04 EST

  • Next message: Tore Halset: "Re: how does cayenne handle java.util.date values ?"

    I'm having a problem w/an NPE. 99.999999% of all our exceptions are
    NPE's, so let me be a bit more specific :-)

    - create child data context
    - Create new record A
    - Create a child record B.
    - Delete child record B. NB! here B is not committed to the database yet.
    - commit on child data context(which goes all the way to the root
    datacontext) => NPE

    I've recently burnt myself on delete rules and I'm wondering if this
    is another incarnation of that problem.

    A has a Cascade delete rule for B. B has a Nullify.

    Cayenne 1.2.1

    Caused by: java.lang.NullPointerException: Attempt to add null target
    DataObject.
            at org.objectstyle.cayenne.CayenneDataObject.addToManyTarget(CayenneDataObject.java:298)
            at org.objectstyle.cayenne.access.ChildDiffLoader.arcCreated(ChildDiffLoader.java:146)
            at org.objectstyle.cayenne.access.ObjectDiff$ArcOperation.apply(ObjectDiff.java:408)
            at org.objectstyle.cayenne.graph.CompoundDiff.apply(CompoundDiff.java:133)
            at org.objectstyle.cayenne.access.ObjectStoreGraphDiff.apply(ObjectStoreGraphDiff.java:155)
            at org.objectstyle.cayenne.access.DataContext.onContextFlush(DataContext.java:1215)
            at org.objectstyle.cayenne.access.DataContext.onSync(DataContext.java:1192)
            at org.objectstyle.cayenne.access.DataContext.flushToParent(DataContext.java:1261)
            at org.objectstyle.cayenne.access.DataContext.commitChangesToParent(DataContext.java:1150)
            at com.zylin.payback.app.html.EditTreatment.submit(EditTreatment.java:209)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.apache.tapestry.listener.ListenerMap.invokeTargetMethod(ListenerMap.java:257)

    -- 
    Øyvind Harboe
    http://www.zylin.com
    



    This archive was generated by hypermail 2.0.0 : Tue Dec 05 2006 - 16:54:41 EST