@Transactional
  protected void removeEntities() {
    HostComponentStateEntity stateEntity = getStateEntity();
    if (stateEntity != null) {
      HostEntity hostEntity = stateEntity.getHostEntity();
      HostComponentDesiredStateEntity desiredStateEntity = getDesiredStateEntity();

      // Make sure that the state entity is removed from its host entity
      hostEntity.removeHostComponentStateEntity(stateEntity);
      hostEntity.removeHostComponentDesiredStateEntity(desiredStateEntity);

      hostDAO.merge(hostEntity);

      hostComponentDesiredStateDAO.remove(desiredStateEntity);
      hostComponentStateDAO.remove(stateEntity);
    }
  }
@param lastOpLastUpdateTime the lastOpLastUpdateTime to set
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java