You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since I want to use atomic operation to update decision along with list of associated legal lists, I tried the following sample request but its failing saying integrity constraint violated FK - parent key not found.
I am getting Database Error - integrity constraint violated - parent key not found.
Observations
• Issue with Foreign Key Constraint:
• It seems that Elide replaces the client-generated ID (temp-decision-1) with an auto-generated ID while persisting Decision.
• When it attempts to insert Legal, it fails because the referenced decision_id (temp-decision-1) is not found in the database.
• Possible Root Cause:
• Elide might be executing both operations simultaneously instead of ensuring Decision is persisted first and then inserting Legal.
• Since Decision.id is auto-generated, Elide cannot resolve the temporary ID correctly before Legal is inserted.
Expected Behavior
• The Decision should be persisted first, generating a valid id.
• The Legal entity should then reference the newly created Decision using the correct id.
• The entire request should execute atomically, ensuring all operations succeed or fail together.
Questions
1. Does Elide guarantee sequential execution in atomic operations (ensuring Decision is persisted first before inserting Legal)?
2. How can I ensure that Legal correctly references the generated Decision.id instead of a temporary client-assigned ID?
3. Is there an alternative way to enforce foreign key constraints while using Atomic Operations in Elide?
I have following 2 entities where in database decision's ID is a FK in legal table.
and
Since I want to use atomic operation to update decision along with list of associated legal lists, I tried the following sample request but its failing saying integrity constraint violated FK - parent key not found.
I am getting Database Error - integrity constraint violated - parent key not found.
Observations
• Issue with Foreign Key Constraint:
• It seems that Elide replaces the client-generated ID (temp-decision-1) with an auto-generated ID while persisting Decision.
• When it attempts to insert Legal, it fails because the referenced decision_id (temp-decision-1) is not found in the database.
• Possible Root Cause:
• Elide might be executing both operations simultaneously instead of ensuring Decision is persisted first and then inserting Legal.
• Since Decision.id is auto-generated, Elide cannot resolve the temporary ID correctly before Legal is inserted.
Expected Behavior
• The Decision should be persisted first, generating a valid id.
• The Legal entity should then reference the newly created Decision using the correct id.
• The entire request should execute atomically, ensuring all operations succeed or fail together.
Questions
1. Does Elide guarantee sequential execution in atomic operations (ensuring Decision is persisted first before inserting Legal)?
2. How can I ensure that Legal correctly references the generated Decision.id instead of a temporary client-assigned ID?
3. Is there an alternative way to enforce foreign key constraints while using Atomic Operations in Elide?
Environment Details
• Elide Version: 7.1.4
• Database Used: Oracle
• Spring Boot Version: 3.3.7
The text was updated successfully, but these errors were encountered: