Package org.castor.jdo.engine

Examples of org.castor.jdo.engine.AbstractConnectionFactory


     * @return ClassDescriptor if exists, otherwise null.
     * @throws MappingException If database can not be instantiated.
     */
    public static ClassDescriptor getClassDescriptor(final String db, final Class type)
    throws MappingException {
        AbstractConnectionFactory cf = DatabaseRegistry.getConnectionFactory(db);
        ClassMolder cm = cf.getEngine().getClassMolderWithDependent(type);
        return cm.getClassDescriptor();
    }
View Full Code Here


       
        // Locate a suitable ConnectionFactory and LockEngine
        // and report if not mapping registered any of the two.
        // A new ODMG engine is created each time with different
        // locking mode.
        AbstractConnectionFactory factory = null;
        try {
            factory = DatabaseRegistry.getConnectionFactory(dbName);
        } catch (MappingException ex) {
            throw new DatabaseNotFoundException(Messages.format("jdo.dbNoMapping", dbName));
        }
        _scope = new PersistenceInfoGroup(new LockEngine[] {factory.getEngine()});
       
        _callback = callback;
        _instanceFactory = instanceFactory;
        _dbName = dbName;
        _lockTimeout = lockTimeout;
View Full Code Here

                    throw new DatabaseNotFoundException(Messages.format(
                            "jdo.dbNoMapping", _dbName));
                }
            }

            AbstractConnectionFactory factory;
            factory = DatabaseRegistry.getConnectionFactory(_dbName);
            _transactionManager = factory.getTransactionManager();
        } catch (MappingException ex) {
            throw new DatabaseNotFoundException(ex);
        }

        /* At this point, we MUST have a instance of TransactionManagerFactory,
View Full Code Here

                }
               
                DatabaseRegistry.loadDatabase(_jdoConfURI, _entityResolver, _classLoader);
            }
           
            AbstractConnectionFactory factory;
            factory = DatabaseRegistry.getConnectionFactory(_databaseName);
            transactionManager = factory.getTransactionManager();
        } catch (MappingException ex) {
            String msg = Messages.format("jdo.problem.loading.conf", _jdoConfURI);
            LOG.error(msg, ex);
            throw new DatabaseNotFoundException(msg, ex);
        }
View Full Code Here

        super.setUp();

        AbstractProperties properties = getProperties();
        boolean useProxies = properties.getBoolean(CPAProperties.USE_JDBC_PROXIES, true);

        AbstractConnectionFactory factory = null;
       
        JdoConf jdoConf = getJdoConf(DBNAME, MAPPING);
        if (jdoConf.getDatabase(0).getDatabaseChoice().getDriver() != null) {
            factory = new DriverConnectionFactory(jdoConf, 0, null);
        } else if (jdoConf.getDatabase(0).getDatabaseChoice().getDataSource() != null) {
            factory = new DataSourceConnectionFactory(jdoConf, 0, new Mapping());
        } else if (jdoConf.getDatabase(0).getDatabaseChoice().getDriver() != null) {
            factory = new JNDIConnectionFactory(jdoConf, 0, null);
        }
       
        factory.initializeFactory();
       
        _connection = factory.createConnection();
       
        // if connection is not wrapped by a proxy yet, create one now
        if (!useProxies) {
            ClassLoader loader = _connection.getClass().getClassLoader();
            Class < ? > [] interfaces = new Class < ? > [] {Connection.class};
View Full Code Here

TOP

Related Classes of org.castor.jdo.engine.AbstractConnectionFactory

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.