Package org.apache.openejb.resource.jdbc

Examples of org.apache.openejb.resource.jdbc.JdbcManagedConnectionFactory


        GeronimoConnectionManagerFactory connectionManagerFactory = new GeronimoConnectionManagerFactory();
        connectionManagerFactory.setTransactionManager(transactionManager);
        ConnectionManager connectionManager = connectionManagerFactory.create();

        ManagedConnectionFactory managedConnectionFactory = new JdbcManagedConnectionFactory("org.hsqldb.jdbcDriver",
                "jdbc:hsqldb:mem",
                "sa",
                "",
                true);

        DataSource dataSource = (DataSource) managedConnectionFactory.createConnectionFactory(connectionManager);

        // todo... conections are not being released
        // for (int i = 0; i < 100; i++) {
        //     System.out.println("Connection " + i);
            verifyDatasource(dataSource);
View Full Code Here


public class SharedLocalConnectionManagerTest extends TestCase {
    public void test() throws Exception {
        TransactionManager transactionManager = new GeronimoTransactionManager();
        ConnectionManager connectionManager = new SharedLocalConnectionManager(transactionManager);

        ManagedConnectionFactory managedConnectionFactory = new JdbcManagedConnectionFactory("org.hsqldb.jdbcDriver",
                "jdbc:hsqldb:mem",
                "sa",
                "",
                true);

        DataSource dataSource = (DataSource) managedConnectionFactory.createConnectionFactory(connectionManager);

        for (int i = 0; i < 100; i++) {
            verifyDatasource(dataSource);
        }
    }
View Full Code Here

        }
        execute(dataSource, create);
    }

    private DataSource createJtaDataSource(TransactionManager transactionManager) throws Exception {
        JdbcManagedConnectionFactory mcf = new JdbcManagedConnectionFactory("org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:JpaTest", "sa", "", false);

        SharedLocalConnectionManager connectionManager = new SharedLocalConnectionManager(transactionManager);

        DataSource connectionFactory = (DataSource) mcf.createConnectionFactory(connectionManager);
        return connectionFactory;
    }
View Full Code Here

            invoke(testObject, "tearDown");
        }
    }

    private DataSource createJtaDataSource(TransactionManager transactionManager) throws Exception {
        JdbcManagedConnectionFactory mcf = new JdbcManagedConnectionFactory("org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:JpaTest", "sa", "", false);

        SharedLocalConnectionManager connectionManager = new SharedLocalConnectionManager(transactionManager);

        DataSource connectionFactory = (DataSource) mcf.createConnectionFactory(connectionManager);
        return connectionFactory;
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.resource.jdbc.JdbcManagedConnectionFactory

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.