Community
Participate
Working Groups
The following scenario will result in a lost update. - Change tracking weaving is enabled - A Lazy xToOne relationship e.g. Order - Item - The underlying variable not named the same as the property. e.g. property name = "item", variable name = "m_item" - Read the owning Object in a new entity manager so the valueholder representing the relationship is not triggered. e.g. find(Order, orderPk) - call a business method on the Owner that changes the target through the instance variable. (i.e. business method does: m_item = new Item) - Trigger the relationship (i.e. order.getItem().getItemId()) - flush In this case, there will be no update. To fix this, there are two options: 1. figure out how EclipseLink can tell if an update is required when using change tracking 2. Disable change tracking for this scenario (i.e. Use Differred Change Tracking)
Did some investigation. It looks like the way to fix this would be to use ASM to figure out what the underlying variable name was and then weave as though we know the variable name. Workarounds: 1. Do not change the underlying variable when using Property Access. Use the getter and setter methods instead. 2. Name the userlying variable the same as the property
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink