Changing the order by parameter when getNextPendingOperation called

Changing the order by parameter to UPDATED_TIMESTAMP.

Resolves wso2/product-iots#1539
merge-requests/1/head
Madawa Soysa 7 years ago
parent 2a01c77ef9
commit 6fed9f7823

@ -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();

Loading…
Cancel
Save