From a32e8111831c0b93d19ffbf9d52b448d69a197ef Mon Sep 17 00:00:00 2001 From: manoj Date: Mon, 6 Apr 2015 17:17:20 +0530 Subject: [PATCH] Update operation DAO implementation --- .../device/mgt/core/operation/mgt/OperationManagerImpl.java | 3 --- .../src/main/resources/dbscripts/cdm/h2.sql | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) 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 809b6abd65..03ea37c9f5 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 @@ -142,10 +142,7 @@ public class OperationManagerImpl implements OperationManager { @Override public Operation getNextPendingOperation(DeviceIdentifier deviceId) throws OperationManagementException { try { - OperationManagementDAOFactory.beginTransaction(); Operation operation = operationDAO.getNextOperation(deviceId); - operation = this.lookupOperationDAO(operation.getType()).getOperation(operation.getId()); - OperationManagementDAOFactory.commitTransaction(); return operation; } catch (OperationManagementDAOException e) { try { diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql index 1ff88a169d..0e8cd993cb 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS DM_CONFIG_OPERATION ( CREATE TABLE IF NOT EXISTS DM_COMMAND_OPERATION ( OPERATION_ID INTEGER NOT NULL, - ENABLED INTEGER NOT NULL DEFAULT 0, + ENABLED BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (OPERATION_ID), CONSTRAINT fk_dm_operation_command FOREIGN KEY (OPERATION_ID) REFERENCES DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION