Geronimo Transaction Manager fails to order SQL INSERT statements so that FK
are not violated (complex objects and EntityManager.persit())
------------------------------------------------------------------------------------------------------------------------------------------
Key: GERONIMO-5293
URL: https://issues.apache.org/jira/browse/GERONIMO-5293
Project: Geronimo
Issue Type: Bug
Security Level: public (Regular issues)
Affects Versions: 2.1.4, 2.1.3
Environment: Windows XP
Reporter: Ćukasz Budnik
Priority: Critical
Geronimo Transaction manager fails to order SQL INSERT statements so that FK
are not violated.
Assume you have 4 entities. A, B, C, and X.
All A, B, C have a FK pointing to X. A has many B (B has FK pointing to A). B
has many C (C has FK pointing to B).
In JPA it's mapped as: A has list of B, and a field of type X, B has a list of
C, and a field of type X, and finally C has a field of type X.
I'm persisting object A, and all inserts are propagated. OpenJPA 1.0.3 (used in
Geronimo 2.1.3) and OpenJPA 1.2.1 (used in 2.1.4) does it without any problems,
Geronimo fails to do so.
The correct answer is:
1. persist all X objects, retrieve theirs PK
2. insert A object, insert X FK, retrieve PK of newly created record
3. insert all B objects, insert X and A FK respectively, retrieve PK of
newly created records
4. insert all C objects, insert X and B FK respectively, retrieve PK of
newly created records
thanks,
Lukasz
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.