Skip to content

EVA-4100 Add end-point to generate Submission ID and link to Eload#40

Merged
nitin-ebi merged 3 commits intoEBIvariation:mainfrom
nitin-ebi:link-submission-id-to-eload
Mar 19, 2026
Merged

EVA-4100 Add end-point to generate Submission ID and link to Eload#40
nitin-ebi merged 3 commits intoEBIvariation:mainfrom
nitin-ebi:link-submission-id-to-eload

Conversation

@nitin-ebi
Copy link
Copy Markdown
Collaborator

No description provided.

@nitin-ebi nitin-ebi self-assigned this Mar 17, 2026
return submissionRepository.save(submission);
}

public String getOrGenerateSubmissionIdForEload(Integer eload) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How would two requests that comes at the same time be handled ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Each request is handled by a separate thread, and as long as they are for different eloads, there should be no issue.
If 2 requests come at the same time for the same eload, there might be a race condition where both of them might try to generate a new ID and enter it into the database. But we have a unique condition on the database where you can have only one entry for an eload, so one will pass, and the other will fail.

On the client side, we have retries, and the failed request should pass on the retry and retrieve the ID that was inserted for the eload.

We can also put all this in a transaction, which should also take care of the race condition.

Comment on lines +125 to +126
@Operation(summary = "This endpoint retrieves the submission id associated with an eload. " +
"If there is no submission id for the eload, it will create one, link it to the eload and then retrieve the same")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to have the security = {@SecurityRequirement(name = "basicAuth") like in markSubmissionProcessStepAndStatus ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is just for Swagger documentation so that Swagger shows the textboxes to enter the credentials.
I have added it to all the remaining endpoints under the admin controller to be consistent.

@nitin-ebi nitin-ebi requested a review from tcezard March 19, 2026 07:00
@nitin-ebi nitin-ebi merged commit cd14d91 into EBIvariation:main Mar 19, 2026
1 check passed
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.

3 participants