Package javax.jdo

Examples of javax.jdo.Query.closeAll()


        func.apply(entry.getValue(), fields);
        fields = null;
      }
    }
    int rv = list.size();
    query.closeAll();
    timingTrace(doTrace, queryText, start, queryTime);
    return rv;
  }

  private static class PartitionFilterGenerator extends TreeVisitor {
View Full Code Here


      params[i + 2] = colNames.get(i);
    }
    Object qResult = query.executeWithArray(params);
    long queryTime = doTrace ? System.nanoTime() : 0;
    if (qResult == null) {
      query.closeAll();
      return null;
    }
    List<Object[]> list = ensureList(qResult);
    if (list.isEmpty()) return null;
    ColumnStatisticsDesc csd = new ColumnStatisticsDesc(true, dbName, tableName);
View Full Code Here

    List<Object[]> list = ensureList(qResult);
    if (list.isEmpty()) return null;
    ColumnStatisticsDesc csd = new ColumnStatisticsDesc(true, dbName, tableName);
    ColumnStatistics result = makeColumnStats(list, csd, 0);
    timingTrace(doTrace, queryText, start, queryTime);
    query.closeAll();
    return result;
  }

  public List<ColumnStatistics> getPartitionStats(String dbName, String tableName,
      List<String> partNames, List<String> colNames) throws MetaException {
View Full Code Here

      params[paramI++] = partName;
    }
    Object qResult = query.executeWithArray(params);
    long queryTime = doTrace ? System.nanoTime() : 0;
    if (qResult == null) {
      query.closeAll();
      return Lists.newArrayList();
    }
    List<Object[]> list = ensureList(qResult);
    List<ColumnStatistics> result = new ArrayList<ColumnStatistics>(
        Math.min(list.size(), partNames.size()));
View Full Code Here

      lastPartName = partName;
      from = i;
    }

    timingTrace(doTrace, queryText, start, queryTime);
    query.closeAll();
    return result;
  }

  /** The common query part for table and partition stats */
  private static final String STATS_COLLIST =
View Full Code Here

      comp = (Competition) it.next();
      logger.log(BasicLevel.DEBUG, "competition:" + comp.getId() + ", tp=" + comp.getTrackpoints().toString() );
    } else {
      logger.log(BasicLevel.DEBUG, "Competition with id "+ idCompetition + " unfound.");
      /* close persistence context */
      qCompetition.closeAll();
      return;
    }
    qCompetition.closeAll();
   
    Iterator    itExtent  = null;
View Full Code Here

      logger.log(BasicLevel.DEBUG, "Competition with id "+ idCompetition + " unfound.");
      /* close persistence context */
      qCompetition.closeAll();
      return;
    }
    qCompetition.closeAll();
   
    Iterator    itExtent  = null;
    Iterator itTp = null;
     
    Extent extent = pm.getExtent(Competition.class, false);
View Full Code Here

        ArrayList found = new ArrayList();
        for (Iterator it = c.iterator(); it.hasNext();) {
            A a = (A) it.next();
            found.add(a.getAid());
        }
        q.closeAll();
        assertSameCollection("Bad result of query on all A instances", expected, found);
        pm.currentTransaction().commit();

        pm.currentTransaction().begin();
        q = pm.newQuery(A.class);
View Full Code Here

        pm.currentTransaction().commit();

        pm.currentTransaction().begin();
        q = pm.newQuery(A.class);
        c = new ArrayList((Collection) q.execute());
        q.closeAll();
        q = pm.newQuery(E.class);
        c.addAll((Collection) q.execute());
        q.closeAll();
        pm.deletePersistentAll(c);
        pm.currentTransaction().commit();
View Full Code Here

        q = pm.newQuery(A.class);
        c = new ArrayList((Collection) q.execute());
        q.closeAll();
        q = pm.newQuery(E.class);
        c.addAll((Collection) q.execute());
        q.closeAll();
        pm.deletePersistentAll(c);
        pm.currentTransaction().commit();
       
        pm.close();
    }
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.