Bug 213039

Summary: EntityManagerJUnitTestSuite.internalTestManagedEmployeesMassInsertOrMerge clean up causes failures in MySQL
Product: z_Archived Reporter: Tom Ware <tom.ware>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: peter.krogh
Version: unspecifiedKeywords: test
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: Fixed in 1.0M4
Attachments:
Description Flags
proposed patch none

Description Tom Ware CLA 2007-12-14 11:29:52 EST
EntityManagerJUnitTestSuite.internalTestManagedEmployeesMassInsertOrMerge does a bulk delete when it tries to clean up.

This causes issues on MySQL because the Employees that are being removed have references to other Employees.  MySQL does not figure out the order the rows need to be removed from the tables and this causes foreign key violations.

The solution is to either do a bulk update of the foreign keys first, or to clean up the Employee.manager and Employee.managedEmployees pointers as the delete is occurring.
Comment 1 Tom Ware CLA 2007-12-14 11:33:41 EST
Created attachment 85293 [details]
proposed patch
Comment 2 Tom Ware CLA 2007-12-14 11:40:10 EST
Checking in a fix.  The bug and solution are described above.

New tests: There are now new tests as this fixes existing failing tests.
Tested with: JPA FullRegressionTestSuite on both Oracle and MySQL
Reviewed by: Guy Pelletier
Comment 3 Peter Krogh CLA 2008-02-06 20:13:27 EST
Adding target Milestone
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:19:06 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink