Examples of SessionFactory


Examples of cirrus.hibernate.SessionFactory

            props.load( in );

            /* Session Factory */
            __logger.info( "...initializing the Hibernate SessionFactory" );

            SessionFactory sessionFactory = ds.buildSessionFactory( props );
            config.getServletContext(  ).setAttribute( SESSION_FACTORY_KEY, sessionFactory );

            __logger.info( "Initialized" );
        }
        catch ( HibernateException h )
View Full Code Here

Examples of cirrus.hibernate.SessionFactory

    public Session getHibernateSession(  )
        throws Exception
    {
        if ( _hibernateSession == null )
        {
            SessionFactory factory = ( SessionFactory ) _application.get( ActionServlet.SESSION_FACTORY_KEY );
            _hibernateSession = factory.openSession(  );
        }

        if ( !_hibernateSession.isOpen(  ) )
        {
            _hibernateSession.reconnect(  );
View Full Code Here

Examples of com.mysql.clusterj.SessionFactory

    }

    public void testNoPooling() {
        Properties modifiedProperties = new Properties();
        modifiedProperties.putAll(props);
        SessionFactory sessionFactory1 = null;
        SessionFactory sessionFactory2 = null;

        // with connection.pool.size set to 1 each session factory should be the same
        modifiedProperties.put(Constants.PROPERTY_CONNECTION_POOL_SIZE, 1);
        sessionFactory1 = ClusterJHelper.getSessionFactory(modifiedProperties);
        sessionFactory2 = ClusterJHelper.getSessionFactory(modifiedProperties);
        sessionFactory1.close();
        sessionFactory2.close();
        errorIfNotEqual("With connection pooling, SessionFactory1 should be the same object as SessionFactory2",
                true, sessionFactory1 == sessionFactory2);

        // with connection.pool.size set to 0 each session factory should be unique
        modifiedProperties.put(Constants.PROPERTY_CONNECTION_POOL_SIZE, 0);
        sessionFactory1 = ClusterJHelper.getSessionFactory(modifiedProperties);
        sessionFactory2 = ClusterJHelper.getSessionFactory(modifiedProperties);
        try {
            SessionFactory sessionFactory3 = ClusterJHelper.getSessionFactory(modifiedProperties);
            sessionFactory3.close();
        } catch (ClusterJFatalUserException ex) {
            // good catch
        }
        sessionFactory1.close();
        sessionFactory2.close();
View Full Code Here

Examples of com.threerings.presents.server.SessionFactory

        throws Exception
    {
        super.init(injector);

        // configure the client to use our whirled client
        _clmgr.setDefaultSessionFactory(new SessionFactory() {
            @Override public Class<? extends PresentsSession> getSessionClass (AuthRequest areq) {
                return WhirledSession.class;
            }
            @Override
            public Class<? extends ClientResolver> getClientResolverClass (Name username) {
View Full Code Here

Examples of net.sf.hibernate.SessionFactory

    }

    protected String doInterceptInternal(ActionInvocation invocation) throws Exception {

        String result = "";
        SessionFactory sessionFactory = lookupSessionFactory();
        Session session = null;
        boolean participate = false;

        if (isSingleSession()) {
            if (TransactionSynchronizationManager.hasResource(sessionFactory)) {
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.api.SessionFactory

        }
        session.getBinding().close();
    }

    protected Session createSession() {
        SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
        Map<String, String> parameter = new HashMap<String, String>();
        parameter.put(SessionParameter.ATOMPUB_URL, CMIS_ENDPOINT_TEST_SERVER);
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

        Repository repository = sessionFactory.getRepositories(parameter).get(0);
        return repository.createSession();
    }
View Full Code Here

Examples of org.apache.cxf.service.invoker.SessionFactory

                Factory f;
                if (scope.factoryClass() == FactoryType.DEFAULT.class) {
                    switch (scope.value()) {
                    case Session:
                        if (scope.args().length > 0) {
                            f = new SessionFactory(cls, Boolean.parseBoolean(scope.args()[0]));
                        } else {
                            f = new SessionFactory(cls);
                        }
                        break;
                    case PerRequest:
                        f = new PerRequestFactory(cls);
                        break;
View Full Code Here

Examples of org.apache.karaf.shell.api.console.SessionFactory

        if (classpath != null) {
            List<URL> urls = getFiles(new File(classpath));
            cl = new URLClassLoader(urls.toArray(new URL[urls.size()]), cl);
        }

        SessionFactory sessionFactory = createSessionFactory(threadio);

        run(sessionFactory, sb.toString(), in, out, err, cl);
    }
View Full Code Here

Examples of org.apache.qpid.transport.Connection.SessionFactory

    private Connection createConnection(final boolean throwException)
    {
        MockTransportConnection connection = new MockTransportConnection();
        connection.setState(State.OPEN);
        connection.setSender(new MockSender());
        connection.setSessionFactory(new SessionFactory()
        {

            public Session newSession(Connection conn, Binary name, long expiry)
            {
                return new MockSession(conn, new SessionDelegate(), name, expiry, throwException);
View Full Code Here

Examples of org.apache.sshd.client.SessionFactory

    protected IoConnector createConnector() {
        return getIoServiceFactory().createConnector(this, getSessionFactory());
    }

    protected SessionFactory createSessionFactory() {
        return new SessionFactory();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.