Package net.sf.hibernate

Examples of net.sf.hibernate.SessionFactory


        info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER);
        info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD);
        ProxoolFacade.registerConnectionPool(url, info);

        Configuration configuration = null;
        SessionFactory sessionFactory = null;
        Session session = null;
        Properties hibernateProperties = new Properties();
        Connection connection = null;

        try {
            hibernateProperties.setProperty(Environment.PROXOOL_EXISTING_POOL, "true");
            hibernateProperties.setProperty(Environment.PROXOOL_POOL_ALIAS, alias);

            configuration = new Configuration().addProperties(hibernateProperties);

            // create a session object to the database
            sessionFactory = configuration.buildSessionFactory();
            session = sessionFactory.openSession();
            assertNotNull("Expected a session", session);

            // Inspect the assigned connection to the session from
            // the pool.
            connection = session.connection();
View Full Code Here


        String testName = "hibernateConfiguredConnection";
        String alias = testName;

        Configuration configuration = null;
        SessionFactory sessionFactory = null;
        Session session = null;
        Properties hibernateProperties = new Properties();
        Connection connection = null;

        try {
            hibernateProperties.setProperty(Environment.PROXOOL_XML, "src/java-test/org/logicalcobwebs/proxool/hibernate.xml");
            hibernateProperties.setProperty(Environment.PROXOOL_POOL_ALIAS, alias);

            configuration = new Configuration().addProperties(hibernateProperties);

            // create a session object to the database
            sessionFactory = configuration.buildSessionFactory();
            session = sessionFactory.openSession();
            assertNotNull("Expected a session", session);

            // Inspect the assigned connection to the session from
            // the pool.
            connection = session.connection();
View Full Code Here

TOP

Related Classes of net.sf.hibernate.SessionFactory

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.