From 6fed9f78238e9bef970fba5f9f7678257daafa55 Mon Sep 17 00:00:00 2001 From: Madawa Soysa Date: Sat, 16 Dec 2017 09:46:23 +0530 Subject: [PATCH] Changing the order by parameter when getNextPendingOperation called Changing the order by parameter to UPDATED_TIMESTAMP. Resolves wso2/product-iots#1539 --- .../core/operation/mgt/dao/impl/GenericOperationDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index 500e48b0ee..a243d91093 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -860,7 +860,7 @@ public class GenericOperationDAOImpl implements OperationDAO { "OPERATION_CODE, om.ID AS OM_MAPPING_ID, om.UPDATED_TIMESTAMP FROM DM_OPERATION o " + "INNER JOIN (SELECT * FROM DM_ENROLMENT_OP_MAPPING dm " + "WHERE dm.ENROLMENT_ID = ? AND dm.STATUS = ?) om ON o.ID = om.OPERATION_ID " + - "ORDER BY o.CREATED_TIMESTAMP ASC LIMIT 1"); + "ORDER BY om.UPDATED_TIMESTAMP ASC LIMIT 1"); stmt.setInt(1, enrolmentId); stmt.setString(2, Operation.Status.PENDING.toString()); rs = stmt.executeQuery();