Update operation rollback and commit

4.x.x
manoj 10 years ago
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…
Cancel
Save