From 3bef9a1ee6b87c7935e233899d79d6309f77ab8b Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Mon, 22 Jul 2024 10:44:49 +0200 Subject: [PATCH] Initialise transactionTemplate if needed (#55) JdbcUtil.getTransactionTemplate() returns null causing null pointer exception. --- src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java b/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java index e75931b2..1f376fa3 100644 --- a/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java +++ b/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java @@ -82,6 +82,9 @@ public static void setDataSource(DataSource value) { } public static TransactionTemplate getTransactionTemplate() { + if (transactionTemplate == null) { + getDataSource(); + } return transactionTemplate; }