Examples of connectionRepository()


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

                // this will load the info from the specified repository file
                // and merge it with the existing info (if it has been loaded)
                metadataManager.mergeConnectionRepository(persistor.readConnectionRepository(_repositoryFile.getAbsolutePath()));
                metadataManager.mergeDescriptorRepository(persistor.readDescriptorRepository(_repositoryFile.getAbsolutePath()));
            }
            else if (metadataManager.connectionRepository().getAllDescriptor().isEmpty() &&
                     metadataManager.getGlobalRepository().getDescriptorTable().isEmpty())
            {
                // Seems nothing was loaded, probably because we're not starting in the directory
                // that the properties file is in, and the repository file path is relative
                // So lets try to resolve this path and load the repository info manually
View Full Code Here

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

                metadataManager.mergeDescriptorRepository(persistor.readDescriptorRepository(repositoryFile.getAbsolutePath()));
            }
            // we might have to determine the default pb key ourselves
            if (metadataManager.getDefaultPBKey() == null)
            {
                for (Iterator it = metadataManager.connectionRepository().getAllDescriptor().iterator(); it.hasNext();)
                {
                    JdbcConnectionDescriptor descriptor = (JdbcConnectionDescriptor)it.next();

                    if (descriptor.isDefaultConnection())
                    {
View Full Code Here

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

            jcd.setJcdAlias(factory.getName() + "_test_checkFactory_a");
            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();
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
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.