From 0a161a07b208a4ad88b301e09471cb0ba74502ad Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 15 Mar 2017 22:20:39 +0100 Subject: Fix bug in statistic logger that broke the authentication process on some protocols if database persist operation failes --- .../moa/id/advancedlogging/StatisticLogger.java | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'id') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java index 5b0f5115d..dfea14a72 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java @@ -205,8 +205,14 @@ public class StatisticLogger implements IStatisticLogger{ } } } - - entityManager.persist(dblog); + + try { + entityManager.persist(dblog); + + } catch (Exception e) { + Logger.warn("Write 'success' statisticLog to database FAILED.", e); + + } } } @@ -227,8 +233,13 @@ public class StatisticLogger implements IStatisticLogger{ } - - entityManager.persist(dblog); + try { + entityManager.persist(dblog); + + } catch (Exception e) { + Logger.warn("Write 'error' statisticLog to database FAILED.", e); + + } } @@ -282,7 +293,13 @@ public class StatisticLogger implements IStatisticLogger{ generateErrorLogFormThrowable(throwable, dblog); - entityManager.persist(dblog); + try { + entityManager.persist(dblog); + + } catch (Exception e) { + Logger.warn("Write 'error' statisticLog to database FAILED.", e); + + } } } -- cgit v1.2.3