Manuel Sánchez created CAY-1807:
-----------------------------------

             Summary: Replace a Detached object  with new one on a relationship 
throws NPE
                 Key: CAY-1807
                 URL: https://issues.apache.org/jira/browse/CAY-1807
             Project: Cayenne
          Issue Type: Improvement
          Components: Core Library
    Affects Versions: 3.0.1
            Reporter: Manuel Sánchez
            Priority: Minor


In the following scenario:
I deleted and persistent object (gets detached) which was used in a relationship
I replaced it with a new one at the end of a relathionship
Cayenne records an ArcDeletedOperation with the detached object involved and 
throws a NPE when commiting.
I solved the problem by disconecting the detached object from the relationship 
(set to null) and then assigning the new one; in two steps

Cayenne could check if its a detached object on that ArcDeletedOperation and 
say so instead of throwing a NPE, or not recording any action, .. something 
more elegant than a NPE

Thanks



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to