Examples of lookupConnection()


Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

                JdbcConnectionDescriptor jcd =
                        MetadataManager.getInstance().connectionRepository().getDescriptor(
                                TestHelper.DEF_KEY);
                ConnectionFactory cf =
                        ConnectionFactoryFactory.getInstance().createConnectionFactory();
                conn = cf.lookupConnection(jcd);
                System.out.println("] Waited for connection " + (System.currentTimeMillis() - startToWait) + "msecs");
                break;
            }
            catch (Throwable t)
            {
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

            jcd.setUseAutoCommit(2);
            // use this attribute to allow OJB changing initial state of connections
            jcd.addAttribute("initializationCheck", "true");

            mm.connectionRepository().addDescriptor(jcd);
            Connection con = conFac.lookupConnection(jcd);
            Connection con2 = conFac.lookupConnection(jcd);
            Connection con3 = conFac.lookupConnection(jcd);
            assertFalse("Expect autocommit state false", con.getAutoCommit());
            con.close();
            con2.close();
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

            // use this attribute to allow OJB changing initial state of connections
            jcd.addAttribute("initializationCheck", "true");

            mm.connectionRepository().addDescriptor(jcd);
            Connection con = conFac.lookupConnection(jcd);
            Connection con2 = conFac.lookupConnection(jcd);
            Connection con3 = conFac.lookupConnection(jcd);
            assertFalse("Expect autocommit state false", con.getAutoCommit());
            con.close();
            con2.close();
            con3.close();
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

            jcd.addAttribute("initializationCheck", "true");

            mm.connectionRepository().addDescriptor(jcd);
            Connection con = conFac.lookupConnection(jcd);
            Connection con2 = conFac.lookupConnection(jcd);
            Connection con3 = conFac.lookupConnection(jcd);
            assertFalse("Expect autocommit state false", con.getAutoCommit());
            con.close();
            con2.close();
            con3.close();
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

                    broker.serviceConnectionManager().getConnectionDescriptor());
            jcd.setJcdAlias(factory.getName() + "_test_checkFactory_b");
            jcd.setUseAutoCommit(1);

            mm.connectionRepository().addDescriptor(jcd);
            con = conFac.lookupConnection(jcd);
            assertTrue("Expect autocommit state true", con.getAutoCommit());
        }
        finally
        {
            if (oldFac != null) fac.setClassToServe(oldFac);
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

            Connection con = null;
            Connection con2 = null;
            Connection con3 = null;
            try
            {
                con = conFac.lookupConnection(jcd);
                con2 = conFac.lookupConnection(jcd);
                try
                {
                    con3 = conFac.lookupConnection(jcd);
                    fail("We expect an exception indicating that the pool is exhausted");
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

            Connection con2 = null;
            Connection con3 = null;
            try
            {
                con = conFac.lookupConnection(jcd);
                con2 = conFac.lookupConnection(jcd);
                try
                {
                    con3 = conFac.lookupConnection(jcd);
                    fail("We expect an exception indicating that the pool is exhausted");
                }
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

            {
                con = conFac.lookupConnection(jcd);
                con2 = conFac.lookupConnection(jcd);
                try
                {
                    con3 = conFac.lookupConnection(jcd);
                    fail("We expect an exception indicating that the pool is exhausted");
                }
                catch (LookupException e)
                {
                    // we expected that
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

        // the repository.xml file.
        ClassDescriptor cld = broker.getClassDescriptor(PerformanceArticle.class);
        JdbcConnectionDescriptor jcd = MetadataManager.getInstance().connectionRepository()
                .getDescriptor(TestHelper.DEF_KEY);
        ConnectionFactory cf = ConnectionFactoryFactory.getInstance().createConnectionFactory();
        Connection conn = cf.lookupConnection(jcd);
        return conn;
    }

   private void returnConnection(Connection conn) throws Exception
    {
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory.lookupConnection()

                JdbcConnectionDescriptor jcd =
                        MetadataManager.getInstance().connectionRepository().getDescriptor(
                                TestHelper.DEF_KEY);
                ConnectionFactory cf =
                        ConnectionFactoryFactory.getInstance().createConnectionFactory();
                conn = cf.lookupConnection(jcd);
                System.out.println("] Waited for connection " + (System.currentTimeMillis() - startToWait) + "msecs");
                break;
            }
            catch (Throwable t)
            {
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.