@Override
    public void afterPhase(PhaseEvent fase) {
      System.out.println("Depois da Fase"+getPhaseId());

      if(fase.getPhaseId().equals(PhaseId.RENDER_RESPONSE)){
          Session session = FacesContextUtil.getRequestSession();
          try {
              session.getTransaction().commit();
          } catch (Exception e) {
              if(session.getTransaction().isActive()){
                  session.getTransaction().rollback();
                  
              }
          }finally{
              session.close();
          }
          
      }
        
    }