From 21782b0714d25c6f3090feefb73d899d613d1b48 Mon Sep 17 00:00:00 2001 From: manoj Date: Wed, 8 Apr 2015 20:49:23 +0530 Subject: [PATCH] Check operation status as pending for next operations --- .../mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java | 3 ++- 1 file changed, 2 insertions(+), 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/OperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java index a8d1e32630..b93739b459 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/OperationDAOImpl.java @@ -260,10 +260,11 @@ public class OperationDAOImpl implements OperationDAO { "INNER JOIN (SELECT dom.OPERATION_ID AS OP_ID FROM (SELECT d.ID " + "FROM DM_DEVICE d INNER JOIN DM_DEVICE_TYPE dm ON d.DEVICE_TYPE_ID = dm.ID AND " + "dm.NAME = ? AND d.DEVICE_IDENTIFICATION = ?) d1 INNER JOIN " + - "DM_DEVICE_OPERATION_MAPPING dom ON d1.ID = dom.DEVICE_ID) ois ON o.ID = ois.OP_ID " + + "DM_DEVICE_OPERATION_MAPPING dom ON d1.ID = dom.DEVICE_ID) ois ON o.STATUS=? AND o.ID = ois.OP_ID " + "ORDER BY o.CREATED_TIMESTAMP ASC LIMIT 1"); stmt.setString(1, deviceId.getType()); stmt.setString(2, deviceId.getId()); + stmt.setString(3, Operation.Status.PENDING.toString()); rs = stmt.executeQuery(); Operation operation = null;