Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346022 - Delete + Insert to a @MantToMany in same transaction causes Inserts to be missed
Summary: Delete + Insert to a @MantToMany in same transaction causes Inserts to be missed
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Tom Ware CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 21:15 EDT by Mitesh Meswani CLA
Modified: 2022-06-09 10:02 EDT (History)
2 users (show)

See Also:


Attachments
Reproduction (16.62 KB, application/x-zip-compressed)
2011-05-16 21:15 EDT, Mitesh Meswani CLA
no flags Details
proposed fix (7.13 KB, patch)
2011-05-30 11:52 EDT, 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 Mitesh Meswani CLA 2011-05-16 21:15:45 EDT
Created attachment 195806 [details]
Reproduction

Attached test case reproduces the issue in JavaSE environment. Here are steps to execute the test case
1. unzip the testcase
2. Adjust build.properties to point to your EcliopseLink workspace
3. Adjust test.properties to point to your database
4. Execute the test using "ant agent run". Observe how expected insert statements into the relationship table are not executed at end of test case

Please note that if agent is not used in above step, insert statements are executed as expected.
Comment 1 Mitesh Meswani CLA 2011-05-16 21:16:11 EDT
This issue was triggered by http://java.net/jira/browse/GLASSFISH-15883
Comment 2 Tom Ware CLA 2011-05-26 14:11:37 EDT
Initial target: 2.3 - pending more triage
Comment 3 Tom Ware CLA 2011-05-26 14:31:56 EDT
Workaround: Use this persistence unit property:

            <property name="eclipselink.weaving.changetracking" value="false"/>
Comment 4 Tom Ware CLA 2011-05-27 11:39:55 EDT
Note: This will only occur if you add and remove the exact same elements.  Any additional added or removed objects will result in the changes being sent.
Comment 5 Tom Ware CLA 2011-05-30 11:52:57 EDT
Created attachment 196914 [details]
proposed fix
Comment 6 Tom Ware CLA 2011-05-30 15:45:27 EDT
The change clears the list of added and removed objects in an IndirectCollection using attribute change tracking at the same time as the change set is cleared

Reviewed by Andrei Ilitchev
Approved by Peter Krogh

Tested with JPA and Core LRG

Added test to EntityManagerJUnitTestCase
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:02:37 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink