Package org.apache.openjpa.persistence.datacache.common.apps

Examples of org.apache.openjpa.persistence.datacache.common.apps.CacheObjectE


            fail("Set up failed due to exception : \n" +
                getStackTrace(e));
        }
        int j = 0;
        for (int i = 0; i < 6; i++) {
            CacheObjectE e;
            if (i < 3)
                e = new CacheObjectE(i + "");
            else
                e = null;

            // make some common names so that GROUP BY is useful.
            if (i % 2 == 0)
View Full Code Here


        EntityManagerFactory emf = getEmf(propsMap);
        _factory = JPAFacadeHelper.toBrokerFactory(emf);

        Broker broker = _factory.newBroker();
        broker.begin();
        CacheObjectE e = new CacheObjectE("bar");
        CacheObjectJ j = new CacheObjectJ("foo", e);
        broker.persist(j, null);
        broker.persist(e, null);
        broker.commit();
        _eId = broker.getObjectId(e);
View Full Code Here

    }

    public void testPCParameter() {
        Broker broker = _factory.newBroker();
        broker.begin();
        CacheObjectE e = (CacheObjectE) broker.find(_eId, true, null);
        Query q = broker.newQuery(JPQLParser.LANG_JPQL,
            "select a from " +
                CacheObjectJ.class.getSimpleName() + " a where a.e = :param");

        Collection c = (Collection) q.execute(new Object[]{ e });
View Full Code Here

            startTx(em);

            // get starting time for sleep calculations below
            Date startTime = new Date();
           
            CacheObjectE e = new CacheObjectE("e");
            em.persist(e);

            CacheObjectF f = new CacheObjectF("f");
            em.persist(f);
View Full Code Here

            startTx(em);

            // get starting time for sleep calculations below
            Date startTime = new Date();

            CacheObjectE e = new CacheObjectE("e");
            em.persist(e);

            CacheObjectF f = new CacheObjectF("f");
            em.persist(f);
View Full Code Here

      */

    public void testAllegedConcurrentModificationException() throws Exception {
        OpenJPAEntityManager em = (OpenJPAEntityManager) factory
            .createEntityManager();
        CacheObjectE e;
        try {
            ClassMetaData meta = JPAFacadeHelper.getMetaData(em,
                CacheObjectE.class);
            if (!isOpenJPACache(meta.getDataCache()))
                return;

            startTx(em);
            e = new CacheObjectE("e");
            em.persist(e);
            endTx(em);
        }
        finally {
            endEm(em);
        }

        em = factory.createEntityManager();
        try {
            startTx(em);

            // find the new object...
            OpenJPAQuery q = em.createQuery("select a FROM "
                + CacheObjectE.class.getSimpleName()
                + " a where a.str = 'e'");
            e = (CacheObjectE) ((Collection) q.getResultList()).iterator()
                .next();

            // ... and modify the changed object.
            e.setStr("e2");
            e.setStr("e3");
            endTx(em);
        }
        finally {
            endEm(em);
        }
View Full Code Here

    public void testQueriesOnCollectionsDontUseCache() {
        OpenJPAEntityManager em = (OpenJPAEntityManager) factory
            .createEntityManager();
        try {
            startTx(em);
            CacheObjectE e = new CacheObjectE("e");
            em.persist(e);
            endTx(em);
        }
        finally {
            endEm(em);
View Full Code Here

    public void testCachedQueryClosureReleasesResources() {
        // PersistenceManagerFactory factory =
        // KodoHelper.createEntityManagerFactory ();
        EntityManager initEm = factory.createEntityManager();
        startTx(initEm);
        CacheObjectE e = new CacheObjectE("e");
        initEm.persist(e);
        endTx(initEm);
        endEm(initEm);

        Broker broker = JPAFacadeHelper.toBrokerFactory(factory).newBroker();
View Full Code Here

            startTx(em);

            // get starting time for sleep calculations below
            Date startTime = new Date();
           
            CacheObjectE e = new CacheObjectE("e");
            em.persist(e);

            CacheObjectF f = new CacheObjectF("f");
            em.persist(f);
View Full Code Here

            startTx(em);

            // get starting time for sleep calculations below
            Date startTime = new Date();

            CacheObjectE e = new CacheObjectE("e");
            em.persist(e);

            CacheObjectF f = new CacheObjectF("f");
            em.persist(f);
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.datacache.common.apps.CacheObjectE

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.