@Transactional
  void persistEntitiesInTransaction(ClusterConfigEntity entity) {
    ClusterEntity clusterEntity = entity.getClusterEntity();

    clusterDAO.createConfig(entity);
    clusterEntity.getClusterConfigEntities().add(entity);

    // save the entity, forcing a flush to ensure the refresh picks up the
    // newest data
    clusterEntity = clusterDAO.merge(clusterEntity, true);
    LOG.info("Persisted config entity with id {} and cluster entity {}", entity.getConfigId(),
        clusterEntity.toString());
  }
Persist the cluster and configuration entities in their own transaction.
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java