From 00e43cf9302b7a439881c326625291d46f26b76c Mon Sep 17 00:00:00 2001 From: ryzheboka <25465835+ryzheboka@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:04:48 +0200 Subject: [PATCH] Closes #2555 - Fix deleteClassification --- .../classification/internal/ClassificationServiceImpl.java | 1 + .../taskana/classification/rest/ClassificationController.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/taskana-core/src/main/java/pro/taskana/classification/internal/ClassificationServiceImpl.java b/lib/taskana-core/src/main/java/pro/taskana/classification/internal/ClassificationServiceImpl.java index 6b2ec9ab77..751806c351 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/classification/internal/ClassificationServiceImpl.java +++ b/lib/taskana-core/src/main/java/pro/taskana/classification/internal/ClassificationServiceImpl.java @@ -154,6 +154,7 @@ public void deleteClassification(String classificationId) if (isReferentialIntegrityConstraintViolation(e)) { throw new ClassificationInUseException(classification, e); } + throw e; } } finally { taskanaEngine.returnConnection(); diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java index c51b98e45c..00cd5930b4 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java @@ -191,7 +191,7 @@ public ResponseEntity updateClassification( * @throws NotAuthorizedException if the user is not authorized to delete a Classification */ @DeleteMapping(path = RestEndpoints.URL_CLASSIFICATIONS_ID) - @Transactional(readOnly = true, rollbackFor = Exception.class) + @Transactional(rollbackFor = Exception.class) public ResponseEntity deleteClassification( @PathVariable String classificationId) throws ClassificationNotFoundException, ClassificationInUseException, NotAuthorizedException {