[ 
https://issues.apache.org/jira/browse/CAY-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ari Maniatis updated CAY-715:
-----------------------------

    Component/s: Core Library

> NPE when deleting child temp objects
> ------------------------------------
>
>                 Key: CAY-715
>                 URL: https://issues.apache.org/jira/browse/CAY-715
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 1.2 branch
>            Reporter: Øyvind Harboe
>
> Perhaps Cayenne is not being used in the right fashion, but it is terribly 
> difficult to translate from that NPE to my crime.
> http://mail-archives.apache.org/mod_mbox/incubator-cayenne-user/200612.mbox/ajax/%[email protected]%3e
> - 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to