Reputation: 1901
I have an environment setup with Java EE (weblogic 10.0). Thus, Kodo/OpenJPA is used as the JPA implementation. For some reasons I want to migrate to EclipseLink. Now I have the following issue:
If I want to remove the Entity A, the entry in the join column should also be deleted
Kodo/OpenJPA -> Deletion successful, SQL Trace shows, that first the AxB rows are deleted
EclipseLink -> Deletion fails, Foreign Key Constraint violation. EL tries to delete Entity A first.
This is all in one transaction (RESOURCE_LOCAL). My thought was, that if something is within a transaction, foreign key constraints may be violated? Can the order of the deletions be changed in a way that first the Join Table rows are deleted?
I use EclipseLink 1.1.4
Thanks for your help, Soccertrash
Upvotes: 1
Views: 507
Reputation: 18379
This issue was fixed in later versions of EclipseLink. Try 2.0, or the latest 2.3.
Otherwise remove the target object from the collection first and call flush.
Upvotes: 1