From e81a90510f4d36c93a5525f166d57eb2059c6d6f Mon Sep 17 00:00:00 2001 From: Harshan Liyanage Date: Thu, 7 Sep 2017 17:24:16 +0530 Subject: [PATCH] Resolved wso2/product-iots#1390 --- .../mgt/mobile/windows/impl/WindowsTokenServiceImpl.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java index 68c40595fc..ab81df77c7 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java @@ -2,8 +2,6 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.TransactionManagementException; -import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException; import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory; import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO; @@ -16,7 +14,6 @@ public class WindowsTokenServiceImpl implements WindowsTokenService { private static WindowsEnrollmentTokenDAO windowsEnrollmentTokenDAO; public WindowsTokenServiceImpl() { - WindowsDAOFactory windowsDAOFactory = new WindowsDAOFactory(); windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl(); } @@ -46,9 +43,8 @@ public class WindowsTokenServiceImpl implements WindowsTokenService { public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException { MobileCacheEntry cacheEntry = null; try { - WindowsDAOFactory.beginTransaction(); + WindowsDAOFactory.openConnection(); cacheEntry = windowsEnrollmentTokenDAO.getCacheToken(token); - WindowsDAOFactory.commitTransaction(); } finally { WindowsDAOFactory.closeConnection(); } @@ -59,9 +55,8 @@ public class WindowsTokenServiceImpl implements WindowsTokenService { throws MobileDeviceManagementDAOException { MobileCacheEntry cacheEntry = null; try { - WindowsDAOFactory.beginTransaction(); + WindowsDAOFactory.openConnection(); cacheEntry = windowsEnrollmentTokenDAO.getCacheTokenFromDeviceId(deviceId); - WindowsDAOFactory.commitTransaction(); } finally { WindowsDAOFactory.closeConnection(); }