mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Update operation rollback and commit
This commit is contained in:
parent
416ef5a745
commit
fc5be1d059
@ -145,11 +145,6 @@ public class OperationManagerImpl implements OperationManager {
|
|||||||
Operation operation = operationDAO.getNextOperation(deviceId);
|
Operation operation = operationDAO.getNextOperation(deviceId);
|
||||||
return operation;
|
return operation;
|
||||||
} catch (OperationManagementDAOException e) {
|
} catch (OperationManagementDAOException e) {
|
||||||
try {
|
|
||||||
OperationManagementDAOFactory.rollbackTransaction();
|
|
||||||
} catch (OperationManagementDAOException e1) {
|
|
||||||
log.warn("Error occurred while roll-backing the transaction", e1);
|
|
||||||
}
|
|
||||||
throw new OperationManagementException("Error occurred while retrieving next pending operation", e);
|
throw new OperationManagementException("Error occurred while retrieving next pending operation", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,6 +159,11 @@ public class OperationManagerImpl implements OperationManager {
|
|||||||
operationDAO.updateOperation(operation);
|
operationDAO.updateOperation(operation);
|
||||||
OperationManagementDAOFactory.commitTransaction();
|
OperationManagementDAOFactory.commitTransaction();
|
||||||
}catch(OperationManagementDAOException ex){
|
}catch(OperationManagementDAOException ex){
|
||||||
|
try {
|
||||||
|
OperationManagementDAOFactory.rollbackTransaction();
|
||||||
|
} catch (OperationManagementDAOException e1) {
|
||||||
|
log.warn("Error occurred while roll-backing the update operation transaction", e1);
|
||||||
|
}
|
||||||
log.error("Error occurred while updating the operation: "+operationId);
|
log.error("Error occurred while updating the operation: "+operationId);
|
||||||
throw new OperationManagementException("Error occurred while update operation", ex);
|
throw new OperationManagementException("Error occurred while update operation", ex);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user