From 7f18f60f207f97aef311f36924904c5685589cb6 Mon Sep 17 00:00:00 2001 From: Andreas Svanberg Date: Fri, 22 Nov 2024 14:33:22 +0100 Subject: [PATCH] Added missing @Transactional With the migration to Spring it is much stricter in requiring @Transactional for all methods that write to the database. --- .../plagiarism/urkund/UrkundSubmissionRepositoryImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/se/su/dsv/scipro/plagiarism/urkund/UrkundSubmissionRepositoryImpl.java b/core/src/main/java/se/su/dsv/scipro/plagiarism/urkund/UrkundSubmissionRepositoryImpl.java index f05cfca647..d88963780e 100644 --- a/core/src/main/java/se/su/dsv/scipro/plagiarism/urkund/UrkundSubmissionRepositoryImpl.java +++ b/core/src/main/java/se/su/dsv/scipro/plagiarism/urkund/UrkundSubmissionRepositoryImpl.java @@ -1,6 +1,7 @@ package se.su.dsv.scipro.plagiarism.urkund; import com.querydsl.jpa.impl.JPAQuery; +import jakarta.transaction.Transactional; import se.su.dsv.scipro.file.FileDescription; import jakarta.inject.Inject; @@ -27,6 +28,7 @@ public class UrkundSubmissionRepositoryImpl implements UrkundSubmissionRepositor } @Override + @Transactional public UrkundSubmission save(final UrkundSubmission submission) { final EntityManager em = entityManagerProvider.get(); if (em.contains(submission)) { @@ -49,6 +51,7 @@ public class UrkundSubmissionRepositoryImpl implements UrkundSubmissionRepositor } @Override + @Transactional public void delete(final UrkundSubmission urkundSubmission) { entityManagerProvider.get().remove(urkundSubmission); } -- 2.39.5