Bug 213039 - EntityManagerJUnitTestSuite.internalTestManagedEmployeesMassInsertOrMerge clean up causes failures in MySQL
Summary: EntityManagerJUnitTestSuite.internalTestManagedEmployeesMassInsertOrMerge cle...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard: Fixed in 1.0M4
Keywords: test
Depends on:
Blocks:
 
Reported: 2007-12-14 11:29 EST by Tom Ware CLA
Modified: 2022-06-09 10:19 EDT (History)
1 user (show)

See Also:


Attachments
proposed patch (1.06 KB, patch)
2007-12-14 11:33 EST, Tom Ware CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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