Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Remove child entity from collection: Best practice?
Remove child entity from collection: Best practice? [message #964893] Tue, 30 October 2012 17:49 Go to next message
Eclipse UserFriend
Hi,

I have following entity classes:

Tectonic and Level have each a list of TectonicsLevels which references both of them. A fourth entity class TectonicsLevelLink references TectonicsLevel one time as parent and one time as child. TectonicsLevel in turn has two collections, a parent and a child collection of TectonicsLevelLink.

My question is (as I tried a lot of configurations without success): What is best practice removing a TectonicsLevel? In OnToMany relationships I have cascadeType.ALL set and orphanRemoval="true". I always get an OptimisticLockException when I remove a TectonicsLevel.

Maybe someone can give me a hint, at least where I find some usefull information about that?

Thank you!
Re: Remove child entity from collection: Best practice? [message #973631 is a reply to message #964893] Tue, 06 November 2012 08:48 Go to previous message
Eclipse UserFriend
Please include your code. An OptimisticLockException is thrown if the version does not match. For the version to match, you need to read the object in the same transaction and not have another transaction update the version before your commit.
Previous Topic:Shallow update and non-nullable fields
Next Topic:Eclipselink and JPA
Goto Forum:
  


Current Time: Thu Jul 24 10:13:31 EDT 2025

Powered by FUDForum. Page generated in 0.05343 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top