Skip to content

Commit

Permalink
remove Propagation.REQUIRES_NEW
Browse files Browse the repository at this point in the history
I don't think we need a new transaction when creating samples
Co-authored-by: Sven F. <[email protected]>
  • Loading branch information
KochTobi committed Jan 27, 2025
1 parent f3f2c69 commit 867d0c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


Expand Down Expand Up @@ -59,7 +58,7 @@ public SampleRepositoryImpl(SampleJpaRepository sampleJpaRepository,
this.projectRepository = Objects.requireNonNull(projectRepository);
}

@Transactional(propagation = Propagation.REQUIRED)
@Transactional
@Override
public Collection<Sample> addAll(Project project,
Collection<Sample> samples) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
Expand Down Expand Up @@ -68,7 +67,7 @@ public SampleRegistrationServiceV2(BatchRegistrationService batchRegistrationSer

@PreAuthorize("hasPermission(#projectId, 'life.qbic.projectmanagement.domain.model.project.Project', 'WRITE')")
@Async
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Transactional
public CompletableFuture<Void> registerSamples(Collection<SampleMetadata> sampleMetadata,
ProjectId projectId, String batchLabel, boolean batchIsPilot, ExperimentReference experiment)
throws RegistrationException {
Expand Down Expand Up @@ -104,7 +103,7 @@ public CompletableFuture<Void> registerSamples(Collection<SampleMetadata> sample

@PreAuthorize("hasPermission(#projectId, 'life.qbic.projectmanagement.domain.model.project.Project', 'WRITE')")
@Async
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Transactional
public CompletableFuture<Void> updateSamples(
Collection<SampleMetadata> sampleMetadata,
ProjectId projectId,
Expand Down

0 comments on commit 867d0c7

Please sign in to comment.