Issue Details (XML | Word | Printable)

Key: JDO-426
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Michael Bouschen
Reporter: Abe White
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

NullCollectionsAndIsEmpty does not unset mapped side of relation

Created: 14/Sep/06 09:32 PM   Updated: 04/Oct/06 07:41 PM
Return to search
Component/s: tck2
Affects Version/s: JDO 2 final
Fix Version/s: JDO 2 TCK challenge fixes

Time Tracking:
Not Specified

Resolution Date: 04/Oct/06 07:41 PM


 Description  « Hide
org.apache.jdo.tck.query.jdoql.NullCollectionsAndIsEmpty uses its localSetUp() method to null the projects of an Employee. However, the Employee.projects field uses mapped-by in its mapping, and per section 15.3 of the JDO 2 spec, that means changes to it aren't reflected in the datastore. To fix, add the following lines after retrieving "emp1" but before nulling its projects in localSetUp():

        for (Iterator itr = emp1.getProjects().iterator(); itr.hasNext();)
            ((Project) itr.next()).removeMember(emp1);


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Abe White added a comment - 14/Sep/06 09:37 PM
I didn't mean to set the priority of this issue to "Major". Please consider a "Minor" issue.

Michael Bouschen added a comment - 04/Oct/06 07:41 PM
This needs to be fixed in the 2.0.1 branch, because the spec is ambiguous with respect to whether changes made on the mapped-by side are reflected in the database or not. The maintenance release will fix the spec and clarify that these changes are written to the database. So both test classes do not need to be changed in the trunk.

I changed classes NullCollectionsAndIsEmpty and NullCollectionsAndContains in the branch 2.0.1 and added code to update the non mapped-by side of the relationship (see revision 452987).