public AlertCurrentEntity merge(AlertCurrentEntity alert, boolean updateCacheOnly) {
    // cache only updates
    if (updateCacheOnly) {
      AlertCacheKey key = AlertCacheKey.build(alert);

      // cache not configured, log error
      if (!m_configuration.isAlertCacheEnabled()) {
        LOG.error(
            "Unable to update a cached alert instance for {} because cached alerts are not enabled",
            key);
      } else {
        // update cache and return alert; no database work
        m_currentAlertCache.put(key, alert);
        return alert;
      }
    }

    return merge(alert);
  }
Updates the internal cache of alerts with the specified alert. Unlike
{@link #merge(AlertCurrentEntity)}, this is not transactional and only
updates the cache.
<p/>
The alert should already exist in JPA - this is mainly to update the text
and timestamp.

@param alert
         the alert to update in the cache (not {@code null}).
@param updateCacheOnly
         if {@code true}, then only the cache is updated and not JPA.
@see Configuration#isAlertCacheEnabled()
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java