@Transactional
  public int removeCurrentByHistoryId(long historyId) {
    TypedQuery<AlertCurrentEntity> query = m_entityManagerProvider.get().createNamedQuery(
      "AlertCurrentEntity.removeByHistoryId", AlertCurrentEntity.class);

    query.setParameter("historyId", historyId);
    int rowsRemoved = query.executeUpdate();

    // if caching is enabled, invalidate the cache to force the latest values
    // back from the DB
    if (m_configuration.isAlertCacheEnabled()) {
      m_currentAlertCache.invalidateAll();
    }

    return rowsRemoved;
  }
Remove a current alert whose history entry matches the specfied ID.

@param   historyId the ID of the history entry.
@return  the number of alerts removed.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java