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

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