@Transactional
  public void remove(StackEntity stack) {
    EntityManager entityManager = entityManagerProvider.get();
    stack = findById(stack.getStackId());
    if (null != stack) {
      entityManager.remove(stack);
    }
  }
Removes the specified stack and all related clusters, services and
components.

@param stack
         the stack to remove.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StackDAO.java