SEBSERV-398 add transaction rollback to delete function

This commit is contained in:
Nadim Ritter 2024-02-07 13:44:33 +01:00
parent f191d59495
commit a34cc8c667

View file

@ -265,7 +265,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
@Override @Override
@Transactional @Transactional
public Result<Collection<EntityKey>> delete(final Set<EntityKey> all) { public Result<Collection<EntityKey>> delete(final Set<EntityKey> all) {
return Result.tryCatch(() -> { return Result.<Collection<EntityKey>>tryCatch(() -> {
final List<Long> ids = extractListOfPKs(all); final List<Long> ids = extractListOfPKs(all);
@ -306,7 +306,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
return ids.stream() return ids.stream()
.map(id -> new EntityKey(id, EntityType.CONFIGURATION_NODE)) .map(id -> new EntityKey(id, EntityType.CONFIGURATION_NODE))
.collect(Collectors.toList()); .collect(Collectors.toList());
}); }).onError(TransactionHandler::rollback);
} }
private void handleConfigTemplateDeletion(final List<Long> configurationIds) { private void handleConfigTemplateDeletion(final List<Long> configurationIds) {