Package org.castor.jdo.engine

Examples of org.castor.jdo.engine.ConnectionFactory


        return _jdo;
    }
   
    public Connection getJDBCConnection() throws SQLException {
        String name = _jdo.getDatabaseName();
        ConnectionFactory factory = null;
        try {
            factory = DatabaseRegistry.getConnectionFactory(name);
        } catch (MappingException ex) {
            throw new SQLException(Messages.format("jdo.dbNoMapping", name));
        }
        return factory.createConnection();
    }
View Full Code Here


        return _jdo;
    }

    public Connection getJDBCConnection() throws SQLException {
        String name = _jdo.getDatabaseName();
        ConnectionFactory factory = null;
        try {
            factory = DatabaseRegistry.getConnectionFactory(name);
        } catch (MappingException ex) {
            throw new SQLException(Messages.format("jdo.dbNoMapping", name));
        }
        return factory.createConnection();
    }
View Full Code Here

    /**
     * Lyfe-cycle methods to close JDOManager instance and initiate resource cleanup.
     */
    public void close () {
        try {
            ConnectionFactory factory = getConnectionFactory();
            LockEngine engine = ((AbstractConnectionFactory) factory).getEngine();
            engine.closeCaches();
        } catch (MappingException e) {
            LOG.fatal ("Problem closing down caches", e);
        }
View Full Code Here

        return internalCount;
    }

    private Connection getSeparateConnection(final Database database)
    throws PersistenceException {
        ConnectionFactory factory = null;
        try {
            factory = DatabaseRegistry.getConnectionFactory(database.getDatabaseName());
        } catch (MappingException e) {
            throw new PersistenceException(Messages.message("persist.cannotCreateSeparateConn"), e);
        }
       
        try {
            Connection conn = factory.createConnection();
            conn.setAutoCommit(false);
            return conn;
        } catch (SQLException e) {
            throw new PersistenceException(Messages.message("persist.cannotCreateSeparateConn"), e);
        }
View Full Code Here

TOP

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

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.