From 0f55d86b08e5c75f9532ef50b5651b40c6ffdc95 Mon Sep 17 00:00:00 2001 From: manoj Date: Tue, 7 Apr 2015 19:37:20 +0530 Subject: [PATCH] Update Operations Begin transactions before update DB --- .../device/mgt/core/operation/mgt/OperationManagerImpl.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/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 610494b011..1f5219ec15 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 @@ -153,9 +153,10 @@ public class OperationManagerImpl implements OperationManager { public void updateOperation(int operationId, Operation.Status operationStatus) throws OperationManagementException { try { - OperationManagementDAOFactory.beginTransaction(); + Operation operation = operationDAO.getOperation(operationId); operation.setStatus(operationStatus); + OperationManagementDAOFactory.beginTransaction(); operationDAO.updateOperation(operation); OperationManagementDAOFactory.commitTransaction(); }catch(OperationManagementDAOException ex){