@Subscribe
  public void onEvent(EntityManagerCacheInvalidationEvent event) {
    try {
      if (null != threadEntityManager && threadEntityManager.isOpen()) {
        threadEntityManager.clear();
      }
    } catch (Throwable throwable) {
      LOG.error("Unable to clear the EntityManager for the scheduler thread", throwable);
    }
  }
Handles {@link EntityManagerCacheInvalidationEvent} instances and instructs
the thread running this scheduler to evict instances from the
{@link EntityManager}.

@param event
         the event to handle (not {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java