From 07b12fe4ea3756267edbdee626162eca3ee7829e Mon Sep 17 00:00:00 2001 From: Ace Date: Tue, 26 Jul 2016 22:03:14 +0530 Subject: [PATCH] Bug fixes --- .../device/details/mgt/impl/DeviceInformationManagerImpl.java | 2 ++ .../carbon/policy/mgt/core/mgt/impl/FeatureManagerImpl.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java index 62fcd3bf82..f8b04edd61 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java @@ -225,6 +225,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { throw new DeviceDetailsMgtException("SQL error occurred while retrieving device from database.", e); } catch (DeviceDetailsMgtDAOException e) { throw new DeviceDetailsMgtException("Exception occurred while retrieving device locations.", e); + } finally{ + DeviceManagementDAOFactory.closeConnection(); } } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/FeatureManagerImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/FeatureManagerImpl.java index ea3ed7cd7f..ee4102bfc9 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/FeatureManagerImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/FeatureManagerImpl.java @@ -245,7 +245,7 @@ public class FeatureManagerImpl implements FeatureManager { @Override public List getFeaturesForProfile(int profileId) throws FeatureManagementException { try { - DeviceManagementDAOFactory.openConnection(); + PolicyManagementDAOFactory.openConnection(); return featureDAO.getFeaturesForProfile(profileId); } catch (FeatureManagerDAOException e) { throw new FeatureManagementException("Error occurred while getting the features", e);