From a34cc8c6672fa991c299c1d4d75f6c88f4ef7e9c Mon Sep 17 00:00:00 2001 From: Nadim Ritter Date: Wed, 7 Feb 2024 13:44:33 +0100 Subject: [PATCH] SEBSERV-398 add transaction rollback to delete function --- .../servicelayer/dao/impl/ConfigurationNodeDAOImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java index 5283e262..0d55745e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java @@ -265,7 +265,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { @Override @Transactional public Result> delete(final Set all) { - return Result.tryCatch(() -> { + return Result.>tryCatch(() -> { final List ids = extractListOfPKs(all); @@ -306,7 +306,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { return ids.stream() .map(id -> new EntityKey(id, EntityType.CONFIGURATION_NODE)) .collect(Collectors.toList()); - }); + }).onError(TransactionHandler::rollback); } private void handleConfigTemplateDeletion(final List configurationIds) {