Skip to content

HTML-760: Fix relationship tag transaction bug#329

Open
arti-nova wants to merge 1 commit into
openmrs:masterfrom
arti-nova:HTML-760
Open

HTML-760: Fix relationship tag transaction bug#329
arti-nova wants to merge 1 commit into
openmrs:masterfrom
arti-nova:HTML-760

Conversation

@arti-nova
Copy link
Copy Markdown

HTML-760: Fix relationship tag transaction bug

JIRA: https://openmrs.atlassian.net/browse/HTML-760

Summary:
This PR fixes the relationship tag transaction bug where relationships were being persisted outside the form submission transaction. Previously, relationships created using the relationship tag were saved immediately, resulting in separate synchronization records.

Now:
Relationship creation is queued in submission actions and processed within the same transaction as form submission, ensuring transactional consistency.

Changes:

  • Updated RelationshipSubmissionElement to queue relationship creation instead of directly persisting relationships.
  • Added integration test to verify relationship is not saved outside the submission transaction.

Testing:

  • mvn clean install -DskipTests=false
  • All tests passing.

Notes:

  • No unrelated files were modified.
  • Code follows module coding conventions.

Copy link
Copy Markdown

@krisha-9 krisha-9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from directly saving the relationship to queuing it via submissionActions looks good and aligns better with the form submission workflow.

One suggestion: consider adding validation or checks to ensure that the relationship object is not null and avoids unintended duplicates before adding it to the queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants