public void saveEntities(List<AlertCurrentEntity> toMerge,
                                 List<AlertCurrentEntity> toCreateHistoryAndMerge) {
    if (m_configuration.isAlertCacheEnabled()) {
      synchronized (this) {
        saveEntitiesTransactional(toMerge, toCreateHistoryAndMerge);
      }
    } else {
      saveEntitiesTransactional(toMerge, toCreateHistoryAndMerge);
    }
  }
Saves alert and alert history entities in single transaction
@param toMerge - merge alert only
@param toCreateHistoryAndMerge - create new history, merge alert
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java