db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-229) Class DeleteCallback must not assume managed relationships.
Date Tue, 06 Dec 2005 18:24:09 GMT
    [ http://issues.apache.org/jira/browse/JDO-229?page=comments#action_12359444 ] 

Craig Russell commented on JDO-229:
-----------------------------------

Just a few comments.

1. The line:
                lifecycleVerifyer = new LifecycleVerifier(result);
should probably also change the name of the variable, to:
                lifecycleVerifier = new LifecycleVerifier(result);

2. The code to clear relationships for the deletePersistentAll problem doesn't appear to solve
the issue. The issue is not relationships FROM the employees, it's relationships TO the employee
that are represented by database constraints.

+     * If instances are employees, then all relationships are cleared. 
* If instances are employees, relationships to the employee are cleared.

+                employee.setDentalInsurance(null); 
employee.getDentalInsurance.setEmployee(null);
+                employee.setMedicalInsurance(null);
employee.getMedicalInsurance.setEmployee(null);
+                employee.setDepartment(null);
don't need anything
+                employee.setFundingDept(null);
don't need anything
+                employee.setManager(null);
don't need anything
+                employee.setMentor(null);
employee.getMentor().setProtege(null);
+                employee.setHradvisor(null);
don't need anything
+                employee.setReviewedProjects(new HashSet());
foreach Project p in employee.getReviewedProjects(){p.removeReviewer(employee);}
+                employee.setProjects(new HashSet());
foreach Project p in employee.getProjects() {p.removeMember(employee);}



> Class DeleteCallback must not assume managed relationships.
> -----------------------------------------------------------
>
>          Key: JDO-229
>          URL: http://issues.apache.org/jira/browse/JDO-229
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>  Attachments: JDO-229.patch
>
> There is a portability issue with test case DeleteCallback:
> The test case assumes that a JDO implementation supports managed relationships, because
it deletes instances which are referenced by other instances. Given that the relationships
are represented by foreign keys in the database for which the delete rule is specified as
RESTRICT, the test will cause errors for JDO implementations which do not support managed
relationships, because it does not nullify those references explicitely, 
> In order to make the test case portable, it should explicitely nullify references to
all deleted objects first. Afterwards, it should call Query.deletePersistentAll. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message