Package javax.jdo

Examples of javax.jdo.PersistenceManager.evictAll()


        pm.currentTransaction().commit();

        logger.log(BasicLevel.INFO, "Empty Cache.");
        persons.clear();
        adds.clear();
        pm.evictAll();
       
        pm.currentTransaction().begin();
        logger.log(BasicLevel.INFO, "Find Employees.");
        Query q = pm.newQuery(Person.class);
        q.setFilter("addresses.id1 == p1");
View Full Code Here


        pm.currentTransaction().commit();

        logger.log(BasicLevel.INFO, "Empty Cache.");
        emps.clear();
        deps.clear();
        pm.evictAll();
       
        pm.currentTransaction().begin();
        logger.log(BasicLevel.INFO, "Find Employees.");
        Query q = pm.newQuery(Employee.class);
        q.setFilter("department.name == p1");
View Full Code Here

      BasicA ba = new BasicA();
      ba.writeF1("testBigExtent_" + NBOBJ);
      pm.makePersistent(ba);
    }
    pm.currentTransaction().commit();
    pm.evictAll();
    pm.close();
  }

  public void test1CreateObjects1000() {
    testCreateObjects(1000);
View Full Code Here

  }

  public void test2BigExtent() {
    logger.log(BasicLevel.WARN, "Using the extent ...");
    PersistenceManager pm = pmf.getPersistenceManager();
    pm.evictAll();
    long t = Calendar.getInstance().getTimeInMillis();
    Extent e = pm.getExtent(BasicA.class, false);
    Iterator it = e.iterator();
    int i= 0;
    while(it.hasNext()) {
View Full Code Here

        int count = ((Long) q2.execute(usernames)).intValue();
        c = (Collection) q.execute(usernames);
        int s = c.size();
        q.closeAll();
        q2.closeAll();
        pm.evictAll();
       
        assertEquals("Bad count result", 3, count);
        assertEquals("Bad result size", 3, s);
       
        pm.currentTransaction().begin();
View Full Code Here

        pm.currentTransaction().begin();
        pm.makePersistentAll(as);
        pm.currentTransaction().commit();
       
        as = null;
        pm.evictAll();
       
        pm.currentTransaction().begin();
        Query q = pm.newQuery(Address.class);
        Collection c = (Collection) q.execute();
        assertSameCollection("Bad collection of address from the query", getData(size), c);
View Full Code Here

            boolean demarcateJDOTx = (performCommit
                    || ((Boolean) needTransactionArray.get(action)).booleanValue())
                    && !pm.currentTransaction().isActive();
      if (PARAMETER_EVICTALL.equalsIgnoreCase(action)) {
          logger.log(BasicLevel.INFO, "Flushing cache ...");
          pm.evictAll();
        resetPools(pm, outStr);
          return "Cache flushed !";
      }
      initPools(pm);
            PollsSynchronizations poolsSync = new PollsSynchronizations();
View Full Code Here

  public static void initTestData(PMHolder pmHolder)
    throws JDOException, Exception {
    String str;
    PersistenceManager pm = pmHolder.getPersistenceManager();
    pm.evictAll();
    Iterator objIter = null;
    DatabaseImpl.poolOfDepartmentId.clear();
    DatabaseImpl.poolOfEmployeeId.clear();
    DatabaseImpl.poolOfProjectId.clear();
    // remove all employee
View Full Code Here

      pm.deletePersistentAll((Collection) pm.newQuery(classes[i]).execute());
      logger.log(BasicLevel.INFO, "All " + classes[i].getName() + " have been removed.");
        }
    pm.currentTransaction().commit();

    pm.evictAll();

    pm.currentTransaction().begin();
    logger.log(BasicLevel.INFO, "Init departments and employees data.");
    for (int i = 0; i < DEPARTMENT_INIT_SIZE; i++) {
      str = DatabaseImpl.instance.doAction(
View Full Code Here

    }
    DatabaseImpl.resetPools = true;
    pm.currentTransaction().commit();
    logger.log(BasicLevel.INFO, "Initial data set.");
    resetPools(pm, null);
    pm.evictAll();
    logger.log(BasicLevel.DEBUG, "Remove all cache entries.");
    pmHolder.closePersistenceManager();
    logger.log(BasicLevel.DEBUG, "Close the persistenceManager.");
  }
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.