Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openbis integration in sample registration #952

Open
1 task done
KochTobi opened this issue Dec 16, 2024 · 0 comments
Open
1 task done

openbis integration in sample registration #952

KochTobi opened this issue Dec 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working high prio tasks that require urgent attention medium Implementation effert triage An issue that is in discussion to be either scheduled for implepmentation or denied

Comments

@KochTobi
Copy link
Member

KochTobi commented Dec 16, 2024

What happened?

This issue is regarding creating samples and experiments.
All those entities are created in the database and in openbis as data is attached to them. However in some cases, failures can cause inconsistencies between openbis and the database.

For more complex actions like the registering of samples failure can cause unexpected inconsistency.

---
title: "sample registration"
---
sequenceDiagram
SampleRegistrationServiceV2 ->> BatchRegistrationService : register batch
BatchRegistrationService ->> BatchDomainService : register
BatchDomainService ->> BatchRepository : add
BatchRepository ->> QbicBatchRepo : save
BatchDomainService ->> DomainEventDispatcher : dispatch batch registered
BatchDomainService ->> BatchRegistrationService : BatchId
BatchRegistrationService ->> SampleRegistrationServiceV2 : BatchId
SampleRegistrationServiceV2 ->> SampleRepository : addAll
SampleRepository ->> SampleJpaRepository : saveAll
SampleRepository ->> SampleDataRepository(OpenBIS) : addSamplesToProject
SampleDataRepository(OpenBIS) ->> OpenBis : createExperiment
SampleDataRepository(OpenBIS) ->> OpenBis : createOpenbisSample
SampleRepository -->> SampleRegistrationServiceV2 : Collection<Sample>
SampleRegistrationServiceV2 ->> ConfoundingVariableService : setVariableLevelsForSamples
ConfoundingVariableService ->> ConfoundingVariableRepository : existsAllById
ConfoundingVariableRepository -->> ConfoundingVariableService : yes
ConfoundingVariableService ->> ConfoundingVariableLevelRepository : save
ConfoundingVariableService -->> SampleRegistrationServiceV2 : List<ConfoundingVariableLevel>
SampleRegistrationServiceV2 ->> BatchRegistrationService : addSamplesToBatch
BatchRegistrationService ->> BatchRepository : find
BatchRegistrationService ->> BatchRepository : update
Loading

Consider an exception after the experiment was created. The experiment stays the same in openbis but the samples and sample batch are rolled back in the database.

Additionally, the experiment and sample codes are derived from listed objects in openbis. When experiments are deleted in openbis, they are placed in the trashcan currently. Identifiers of objects in the trashcan are still considered present even though those objects are not listed with the API. So after a "rollback" of a failure after the experiment was created, the experiment still exists in the trash can. The next sample registration will fail as well as the experiment code is already taken.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@KochTobi KochTobi added bug Something isn't working triage An issue that is in discussion to be either scheduled for implepmentation or denied labels Dec 16, 2024
@KochTobi KochTobi changed the title openbis integration in sample registration and project creation openbis integration in sample registration Dec 16, 2024
@Steffengreiner Steffengreiner added medium Implementation effert high prio tasks that require urgent attention labels Jan 16, 2025
@Steffengreiner Steffengreiner moved this to Approve in Issue triage Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high prio tasks that require urgent attention medium Implementation effert triage An issue that is in discussion to be either scheduled for implepmentation or denied
Projects
Status: Approve
Status: Todo
Development

No branches or pull requests

4 participants