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 f4dae501676..809b6abd657 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 @@ -164,12 +164,15 @@ public class OperationManagerImpl implements OperationManager { } private OperationDAO lookupOperationDAO(Operation operation) { + if (operation instanceof CommandOperation) { return commandOperationDAO; + } else if (operation instanceof ProfileOperation) { + return profileOperationDAO; } else if (operation instanceof ConfigOperation) { return configOperationDAO; - } else { - return profileOperationDAO; + }else{ + return operationDAO; } }