Package org.picketlink.identity.federation.web.servlets

Examples of org.picketlink.identity.federation.web.servlets.IDPServlet$SessionHolder


      }
    }
    else {
      if (isSingleSession()) {
        // single session mode
        SessionHolder sessionHolder =
            (SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
        logger.debug("Closing single Hibernate Session in OpenSessionInViewInterceptor");
        SessionFactoryUtils.closeSession(sessionHolder.getSession());
      }
      else {
        // deferred close mode
        SessionFactoryUtils.processDeferredClose(getSessionFactory());
      }
View Full Code Here


        participate = true;
      }
      else {
        logger.debug("Opening single Hibernate Session in OpenSessionInViewFilter");
        Session session = getSession(sessionFactory);
        TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));
      }
    }
    else {
      // deferred close mode
      if (SessionFactoryUtils.isDeferredCloseActive(sessionFactory)) {
        // Do not modify deferred close: just set the participate flag.
        participate = true;
      }
      else {
        SessionFactoryUtils.initDeferredClose(sessionFactory);
      }
    }

    try {
      filterChain.doFilter(request, response);
    }

    finally {
      if (!participate) {
        if (isSingleSession()) {
          // single session mode
          SessionHolder sessionHolder =
              (SessionHolder) TransactionSynchronizationManager.unbindResource(sessionFactory);
          logger.debug("Closing single Hibernate Session in OpenSessionInViewFilter");
          closeSession(sessionHolder.getSession(), sessionFactory);
        }
        else {
          // deferred close mode
          SessionFactoryUtils.processDeferredClose(sessionFactory);
        }
View Full Code Here

  private Session getHibernateSession(FlowSession session) {
    return (Session) session.getScope().get(PERSISTENCE_CONTEXT_ATTRIBUTE);
  }

  private void bind(Session session) {
    TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));
  }
View Full Code Here

    }
    else {
      _log.debug("Session does not have transaction attached... Creating new one");
      existing = false;
      session = SessionFactoryUtils.getSession(sessionFactory, true);
      SessionHolder sessionHolder = new SessionHolder(session);
      TransactionSynchronizationManager.bindResource(sessionFactory, sessionHolder);
    }

    return new SessionContainer(session, existing);
  }
View Full Code Here

    if (session._existingSession) {
      return;
    }

    SessionFactory sessionFactory = getSessionFactory();
    SessionHolder sessionHolder = (SessionHolder)TransactionSynchronizationManager.unbindResource(sessionFactory);
    SessionFactoryUtils.releaseSession(sessionHolder.getSession(), sessionFactory);
    _log.debug("Session released");
  }
View Full Code Here

            session = ((SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory)).getSession();
        } else {
            _log.debug("Session does not have transaction attached... Creating new one");
            existing = false;
            session = SessionFactoryUtils.getSession(sessionFactory, true);
            SessionHolder sessionHolder = new SessionHolder(session);
            TransactionSynchronizationManager.bindResource(sessionFactory, sessionHolder);
        }

        return new SessionContainer(session, existing);
    }
View Full Code Here

        if (session._existingSession) {
            return;
        }

        SessionFactory sessionFactory = getSessionFactory();
        SessionHolder sessionHolder = (SessionHolder) TransactionSynchronizationManager.unbindResource(sessionFactory);
        SessionFactoryUtils.releaseSession(sessionHolder.getSession(), sessionFactory);
        _log.debug("Session released");
    }
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    SessionFactory factory = this.getSessionFactory();
    this.session = SessionFactoryUtils.getSession(factory, true);
    this.bind(factory, new SessionHolder(this.session));
  }
View Full Code Here

  }

  @Override
  protected void tearDown() throws Exception {
    SessionFactory factory = this.getSessionFactory();
    SessionHolder sessionHolder = (SessionHolder) this.unbind(factory);
    SessionFactoryUtils.closeSession(sessionHolder.getSession());
  }
View Full Code Here


        try {
            log.debug("Opening Hibernate Session");
            session = createSession(sessionFactory);
            TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));

            databaseMessageCache.loadMessageFormats();

            reloadResources(true);
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.web.servlets.IDPServlet$SessionHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.