Esempio n. 1
0
  public boolean isSessionInvalidated() {
    // Double check to ensure that the session exists, but don't create it.
    if (session == null) {
      session = sessionFactory.getSession(false);
    }

    return session != null && session.isInvalidated();
  }
Esempio n. 2
0
  public Session getSession(boolean create) {
    if (session != null && session.isInvalidated()) {
      session = null;
    }

    if (session == null) {
      // TAP5-1489 - Re-storage of session attributes at end of request should be configurable
      session = sessionFactory.getSession(create);
    }

    return session;
  }