Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] detached object changes aren't completely merged?

Hi,

The changes you list below cover what I was suggesting. It looks like you have found a bug. Please file one in the Eclipse system.

You should be able to work around this issue using this persistence unit property:

<property name="eclipselink.cache.shared.default" value="false"/>

  (you no longer need to disable weaving of change tracking)

-Tom

On 05/12/2012 3:22 AM, hilmarf wrote:
Hi Tom,

I don't get it... What do you mean with:

Tom Ware wrote
(You have not maintained identity on the client side.)

???

I added an equals() and hashCode() implementation on child and parent...
And I'm correcting the collection on the client:
         Collection<Child> children = mom.getChilds();
         if (children == null) {
             children = new LinkedList<Child>();
         }
         children.clear();
         children.add(child);
         mom.setChilds(children);


Alright I changed my 'save' method on the server, so that I always merge the
parent before the child. (But for my real product this can't be the
solution, because I'm dealing with a lot of entities with different
bi-directional relations.)

         transaction.begin();
         mom = em.merge(mom);
         child = em.merge(child);
until here everything seams fine, but after the commit:
         transaction.commit();
the child has the OLD name again!?!?

Complete updated sources:  src.zip
<http://eclipse.1072660.n5.nabble.com/file/n156232/src.zip>

I'm glad about any working solution.
Thanks.

-Hilmar



--
View this message in context: http://eclipse.1072660.n5.nabble.com/detached-object-changes-aren-t-completely-merged-tp156056p156232.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top