From d95a198ad62b74ad60adc2a52df636785aff56c6 Mon Sep 17 00:00:00 2001 From: harshanl Date: Mon, 30 Nov 2015 19:56:47 +0530 Subject: [PATCH] Fixed EMM-1001 --- .../carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java | 2 +- .../device/mgt/core/operation/mgt/OperationManagerImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java index aedc981f48..c5b7a4e13e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java @@ -609,7 +609,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { stmt.setString(index++, status.toString()); stmt.setInt(index, tenantId); rs = stmt.executeQuery(); - if (rs.next()) { + while (rs.next()) { enrolments.add(DeviceManagementDAOUtil.loadEnrolment(rs)); } return enrolments; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 58cb057153..7ef4b8f5da 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -97,7 +97,7 @@ public class OperationManagerImpl implements OperationManager { List enrolments; try { DeviceManagementDAOFactory.openConnection(); - enrolments = deviceDAO.getEnrolmentsByStatus(deviceIds, EnrolmentInfo.Status.ACTIVE, tenantId); + enrolments = deviceDAO.getEnrolmentsByStatus(authorizedDeviceList, EnrolmentInfo.Status.ACTIVE, tenantId); } catch (SQLException e) { throw new OperationManagementException("Error occurred while opening a connection the data " + "source", e);