From a2b8b8bda231e1585bd518191c4dfdc49d22d5ae Mon Sep 17 00:00:00 2001 From: "osh.silva" Date: Thu, 19 Sep 2024 14:17:26 +0530 Subject: [PATCH] Remove unwanted connection --- .../core/service/DeviceManagementProviderServiceImpl.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 9949cc24b1..df57af8444 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -1177,7 +1177,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv public double generateCost(List allDevices, Timestamp startDate, Timestamp endDate, Cost tenantCost, List deviceStatusNotAvailable, double totalCost) throws DeviceManagementException { List deviceStatus; try { - DeviceManagementDAOFactory.getConnection(); for (Device device : allDevices) { long dateDiff = 0; int tenantId = this.getTenantId(); @@ -1228,10 +1227,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv String msg = "Error occurred in retrieving status history for a device in billing."; log.error(msg, e); throw new DeviceManagementException(msg, e); - } catch (SQLException e) { - String msg = "Error occurred while opening a connection to the data source"; - log.info(msg, e); - throw new DeviceManagementException(msg, e); } return totalCost; }