Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.JDOManager


        return (engine == DatabaseEngineType.MYSQL)
            || (engine == DatabaseEngineType.SQL_SERVER);
    }
   
    public void delete() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.setAutoCommit(true);
        conn.createStatement().execute("DELETE FROM TEST2550_ENTITY");
        conn.close();
    }
View Full Code Here


    public static void main(final String[] args) throws Exception {
        long startTime = System.currentTimeMillis();

        String config = TestSoak.class.getResource("jdo-conf.xml").toString();
        JDOManager.loadConfiguration(config);
        JDOManager manager = JDOManager.createInstance("soak");

        AbstractSoakThread testA = new SoakThreadA(manager);
        AbstractSoakThread testB = new SoakThreadB(manager);

        testA.start();
View Full Code Here

    // -----------------------------------------------------------------------------------
   
    public void setUp () throws Exception {
        JDOManager.loadConfiguration(
                TestCastorAppender.class.getResource(JDO_CONF).toString());
        JDOManager jdo = JDOManager.createInstance("LOGGING");
        Database db = jdo.getDatabase();
        db.begin();
        Connection connection = db.getJdbcConnection();
        Statement statement = connection.createStatement();
        statement.executeUpdate("DROP TABLE LOG_EXTENSION");
        statement.executeUpdate("DROP TABLE LOG_EXCEPTION");
View Full Code Here

    public void testInsert() throws Exception {
        LOG.info("Starting Field with Space test.");
       
        String config = getClass().getResource("jdo-conf.xml").toString();
        JDOManager.loadConfiguration(config);
        JDOManager jdo = JDOManager.createInstance("test1900");
        Database db = jdo.getDatabase();
       
        BeanObject object = new BeanObject();
        object.setField1("Test Field 1.");
        object.setField2("Test Field 2.");
        db.begin();
View Full Code Here

            || (engine == DatabaseEngineType.ORACLE)
            || (engine == DatabaseEngineType.SQL_SERVER);
    }
   
    public void delete() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.setAutoCommit(true);
        conn.createStatement().execute("DELETE FROM test87_entity");
        conn.close();
       
        LOG.debug("Deleted all records from database.");

        // Expire all objects in cache
        Database db = jdo.getDatabase();
        db.getCacheManager().expireCache();
        db.close();
       
        LOG.debug("Expired all objects from cache.");
    }
View Full Code Here

    public boolean exclude(final DatabaseEngineType engine) {
        return (engine == DatabaseEngineType.SQL_SERVER);
    }
   
    public void deleteUnidirectional() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.createStatement().execute("DELETE FROM TEST1196_STATE");
        conn.createStatement().execute("DELETE FROM TEST1196_COUNTRY");
        conn.close();
    }
View Full Code Here

        db.commit();
        db.close();
    }
   
    public void deleteSimpleBidirectional() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.createStatement().execute("UPDATE TEST1196_CAR SET DRIVER=null");
        conn.createStatement().execute("UPDATE TEST1196_DRIVER SET CAR=null");
        conn.createStatement().execute("DELETE FROM TEST1196_CAR");
        conn.createStatement().execute("DELETE FROM TEST1196_DRIVER");
        conn.close();
View Full Code Here

        db.commit();
        db.close();
    }
   
    public void deleteComplexBidirectional() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.createStatement().execute("DELETE FROM TEST1196_COMPUTER");
        conn.createStatement().execute("DELETE FROM TEST1196_ORDERITEM");
        conn.createStatement().execute("DELETE FROM TEST1196_PRODUCT");
        conn.createStatement().execute("DELETE FROM TEST1196_ORDER");
        conn.close();
View Full Code Here

            || (engine == DatabaseEngineType.ORACLE)
            || (engine == DatabaseEngineType.SQL_SERVER);
    }
   
    public void delete() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.setAutoCommit(true);
        conn.createStatement().execute("DELETE FROM TEST1206_STATE");
        conn.createStatement().execute("DELETE FROM TEST1206_COUNTRY");
        conn.close();
    }
View Full Code Here

        db.begin();
        state = (State) db.load(State.class, "AASTBRPR");
        db.commit();
       
        //3. lets check if database changes too
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.setAutoCommit(true);
        ResultSet rs = conn.createStatement().executeQuery(
                "SELECT * FROM TEST1206_STATE WHERE oid = '" + state.getOid() + "'");
        if (rs.next()) {
            String persCountry = rs.getString("COUNTRY");
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.JDOManager

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.