Examples of connectionRepository()


Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

            JdbcConnectionDescriptor jcd = (JdbcConnectionDescriptor) SerializationUtils.clone(
                    broker.serviceConnectionManager().getConnectionDescriptor());
            jcd.setJcdAlias(factory.getName() + "_test_checkFactory_a");
            jcd.setUseAutoCommit(2);

            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();
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

            jcd = (JdbcConnectionDescriptor) SerializationUtils.clone(
                    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
        {
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

                    broker.serviceConnectionManager().getConnectionDescriptor());
            jcd.setJcdAlias(factory.getName() + "_test_checkFactoryPoolExhausted_1");
            jcd.setUseAutoCommit(1);
            jcd.getConnectionPoolDescriptor().setMaxActive(2);
            jcd.getConnectionPoolDescriptor().setConnectionFactory(factory);
            mm.connectionRepository().addDescriptor(jcd);

            Connection con = null;
            Connection con2 = null;
            Connection con3 = null;
            try
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

    protected void setUp() throws Exception
    {
        super.setUp();
        MetadataManager mm = MetadataManager.getInstance();
        JdbcConnectionDescriptor jcd = mm.connectionRepository().getDescriptor(TestHelper.FAR_AWAY_KEY);
        if(jcd == null)
        {
            ConnectionRepository cr = mm.readConnectionRepository(TestHelper.FAR_AWAY_CONNECTION_REPOSITORY);
            mm.connectionRepository().addDescriptor(cr.getDescriptor(TestHelper.FAR_AWAY_KEY));
        }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

        MetadataManager mm = MetadataManager.getInstance();
        JdbcConnectionDescriptor jcd = mm.connectionRepository().getDescriptor(TestHelper.FAR_AWAY_KEY);
        if(jcd == null)
        {
            ConnectionRepository cr = mm.readConnectionRepository(TestHelper.FAR_AWAY_CONNECTION_REPOSITORY);
            mm.connectionRepository().addDescriptor(cr.getDescriptor(TestHelper.FAR_AWAY_KEY));
        }
    }

    protected void tearDown() throws Exception
    {
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

    }

    protected void tearDown() throws Exception
    {
        MetadataManager mm = MetadataManager.getInstance();
        JdbcConnectionDescriptor jcd = mm.connectionRepository().getDescriptor(TestHelper.FAR_AWAY_KEY);
        mm.connectionRepository().removeDescriptor(jcd);
        super.tearDown();
    }

    public static void main(String[] args)
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

    protected void tearDown() throws Exception
    {
        MetadataManager mm = MetadataManager.getInstance();
        JdbcConnectionDescriptor jcd = mm.connectionRepository().getDescriptor(TestHelper.FAR_AWAY_KEY);
        mm.connectionRepository().removeDescriptor(jcd);
        super.tearDown();
    }

    public static void main(String[] args)
    {
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

        PersistenceBrokerFactory.releaseAllInstances();
        String old = null;
        try
        {
            MetadataManager mm = MetadataManager.getInstance();
            JdbcConnectionDescriptor jcd = mm.connectionRepository().getDescriptor(mm.getDefaultPBKey());
            if(jcd.getObjectCacheDescriptor().getObjectCache().equals(ObjectCacheEmptyImpl.class))
            {
                ojbSkipTestMessage("Doesn't work with " + ObjectCacheEmptyImpl.class + " as default cache.");
                return;
            }
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

        PBKey tempKey = new PBKey(jcdAlias, TestHelper.DEF_KEY.getUser(), TestHelper.DEF_KEY.getPassword());
        MetadataManager mm = MetadataManager.getInstance();
        PersistenceBroker broker = null;
        try
        {
            JdbcConnectionDescriptor jcd = mm.connectionRepository().getDescriptor(TestHelper.DEF_KEY);
            jcd = (JdbcConnectionDescriptor) SerializationUtils.clone(jcd);
            // modify jcd copy
            jcd.setJcdAlias(jcdAlias);
            SequenceDescriptor sd = jcd.getSequenceDescriptor();
            assertNotNull("Can not find sequence-descriptor - check test", sd);
View Full Code Here

Examples of org.apache.ojb.broker.metadata.MetadataManager.connectionRepository()

            SequenceDescriptor sd = jcd.getSequenceDescriptor();
            assertNotNull("Can not find sequence-descriptor - check test", sd);
            // don't use autoNaming
            sd.addAttribute("autoNaming", "false");
            // add new connection descriptor to global base
            mm.connectionRepository().addDescriptor(jcd);

            // allow per thread changes of persistent object data
            mm.setEnablePerThreadChanges(true);
            DescriptorRepository dr = mm.copyOfGlobalRepository();
            ClassDescriptor cld = dr.getDescriptorFor(SMAutoNaming.class);
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.