NPE when deleting child temp objects
------------------------------------
Key: CAY-715
URL: http://issues.apache.org/cayenne/browse/CAY-715
Project: Cayenne
Type: Bug
Versions: 1.2 [STABLE]
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.
- 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/cayenne/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
This archive was generated by hypermail 2.0.0 : Wed Dec 06 2006 - 03:19:34 EST