diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index 576eec9a6ce..2d1a7e5411e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -941,7 +941,7 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc "ON " + "AP_DEVICE_SUBSCRIPTION.AP_APP_RELEASE_ID = AP_APP_RELEASE.AP_APP_ID " + "WHERE PACKAGE_NAME = ? " + - "AND DM_DEVICE_ID = ?" + + "AND DM_DEVICE_ID = ? " + "AND UNSUBSCRIBED = 'FALSE' " + "AND STATUS = 'COMPLETED';"; try (PreparedStatement stmt = conn.prepareStatement(sql)) {