Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerFactory.createEntityManager()


    private void doOrderingTest(boolean rollback) {
        Map props = new HashMap();
        props.put("openjpa.SavepointManager",
            TrackingSavepointManager.class.getName());
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();
        startTx(pm);
        pm.setSavepoint("before");
        pm.setSavepoint("before2");
        pm.setSavepoint("test");
        pm.setSavepoint("test2");
View Full Code Here


    public void testDisallowFlush() {
        Map props = new HashMap();
        props.put("openjpa.SavepointManager",
            TrackingSavepointManager.class.getName() + "(AllowFlush=false)");
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();
        startTx(pm);
        pm.persist(new RuntimeTest1());
        pm.setSavepoint("a");
        try {
            pm.flush();
View Full Code Here

    public void testDisallowFlush2() {
        Map props = new HashMap();
        props.put("openjpa.SavepointManager",
            TrackingSavepointManager.class.getName() + "(AllowFlush=false)");
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();

        startTx(pm);
        pm.persist(new RuntimeTest1());
        pm.flush();
        try {
View Full Code Here

    public void testAllowFlush() {
        Map props = new HashMap();
        props.put("openjpa.SavepointManager",
            TrackingSavepointManager.class.getName() + "(AllowFlush=true)");
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();

        startTx(pm);
        pm.persist(new RuntimeTest1());
        pm.setSavepoint("a");
        try {
View Full Code Here

    public void testAllowFlush2() {
        Map props = new HashMap();
        props.put("openjpa.SavepointManager",
            TrackingSavepointManager.class.getName() + "(AllowFlush=true)");
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();

        startTx(pm);
        pm.persist(new RuntimeTest1());
        pm.flush();
        try {
View Full Code Here

        System.out.println("Baseline, starting memory for N objects of " +
            NUM_OBJECTS);
        OpenJPAEntityManagerFactory kpmf =
            (OpenJPAEntityManagerFactory) getEmf();
        OpenJPAEntityManager kpm = (OpenJPAEntityManager)
            kpmf.createEntityManager();

        startTx(kpm);
        int runningId = performAddsModifiesDeletes(kpm, NUM_OBJECTS, 0);
        endTx(kpm);
View Full Code Here

        startTx(em);
    }

    public void testNonTransactionalWrite() throws Exception {
        OpenJPAEntityManagerFactory factory = broker();
        OpenJPAEntityManager em = factory.createEntityManager();
        OpenJPAQuery q = em.createQuery(
            "SELECT o FROM RuntimeTest1 o ORDER BY o.stringField ASC");
        q.setSubclasses(false);
        Collection c = (Collection) q.getResultList();
View Full Code Here

        Map props = new HashMap();
        props.put("openjpa.Multithreaded", "true");
        OpenJPAEntityManagerFactory pmf =
            (OpenJPAEntityManagerFactory) getEmf(props);
        pm = pmf.createEntityManager();
        startTx(pm);
    }

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

    public void doCleanUpTest(boolean commit) {
        Map<String, String> props = new HashMap<String, String>();
        props.put("openjpa.SavepointManager",
            TrackingSavepointManager.class.getName());
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();
        startTx(pm);
        pm.setSavepoint("test");
        pm.setSavepoint("test2");
        if (commit)
            endTx(pm);
View Full Code Here

    private void doOrderingTest(boolean rollback) {
        Map<String, String> props = new HashMap<String, String>();
        props.put("openjpa.SavepointManager",
            TrackingSavepointManager.class.getName());
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();
        startTx(pm);
        pm.setSavepoint("before");
        pm.setSavepoint("before2");
        pm.setSavepoint("test");
        pm.setSavepoint("test2");
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.