From 8f6f39f81561e57d62f385540ef743a858d4a3ac Mon Sep 17 00:00:00 2001 From: mythoss Date: Tue, 7 Apr 2020 17:13:29 +0200 Subject: [PATCH 1/2] Mailtransport connection (#117) Close session after mail was sent Co-authored-by: michael.gruber --- .../notifications/impl/api/transports/MailTransport.java | 1 + 1 file changed, 1 insertion(+) diff --git a/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/api/transports/MailTransport.java b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/api/transports/MailTransport.java index c22745e5c0f..7da296f7c63 100644 --- a/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/api/transports/MailTransport.java +++ b/model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/api/transports/MailTransport.java @@ -326,6 +326,7 @@ public String getContentType() { long duration = System.currentTimeMillis() - start; task.recordState("Notification mail sent successfully via " + host + ", in " + duration + " ms overall."); task.recordNotificationOperation(NAME, true, duration); + t.close(); return; } catch (MessagingException e) { String msg = "Couldn't send mail message to " + mailMessage.getTo() + " via " + host + ", trying another mail server, if there is any"; From ecf5c7f62e209e8388d6740cc789b00ec26e44cf Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 7 Apr 2020 17:43:49 +0200 Subject: [PATCH 2/2] MID-6200 save in background fix --- .../midpoint/web/page/admin/PageAdminObjectDetails.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java index b4211346509..03f1f23782c 100755 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java @@ -822,7 +822,7 @@ public void saveOrPreviewPerformed(AjaxRequestTarget target, OperationResult res if (checkValidationErrors(target, validationErrors)) { return; } - if (isSaveInBackground()){ + if (isSaveInBackground() && !previewOnly){ progressPanel.executeChangesInBackground(deltas, previewOnly, options, task, result, target); } else { progressPanel.executeChanges(deltas, previewOnly, options, task, result, target); @@ -871,7 +871,7 @@ public void saveOrPreviewPerformed(AjaxRequestTarget target, OperationResult res if (checkValidationErrors(target, validationErrors)) { return; } - if (isSaveInBackground()){ + if (isSaveInBackground() && !previewOnly){ progressPanel.executeChangesInBackground(deltas, previewOnly, options, task, result, target); } else { progressPanel.executeChanges(deltas, previewOnly, options, task, result, target); @@ -881,13 +881,13 @@ public void saveOrPreviewPerformed(AjaxRequestTarget target, OperationResult res if (checkValidationErrors(target, validationErrors)) { return; } - if (isSaveInBackground()){ + if (isSaveInBackground() && !previewOnly){ progressPanel.executeChangesInBackground(deltas, previewOnly, options, task, result, target); } else { progressPanel.executeChanges(deltas, previewOnly, options, task, result, target); } } else if (previewOnly && delta.isEmpty() && delegationChangesExist){ - if (isSaveInBackground()){ + if (isSaveInBackground() && !previewOnly){ progressPanel.executeChangesInBackground(deltas, previewOnly, options, task, result, target); } else { progressPanel.executeChanges(deltas, previewOnly, options, task, result, target);