3 Replies Latest reply on Aug 1, 2007 7:39 PM by Matt Drees

    How can I disable the query cache?

    Chico Chen Newbie

      I find "project.moduleItems" can't be refreshed automaticly, after adding a new module.

      Are there any ways to just clear certain object - "project",
      I not like to use "entityManager.clear();", as I know it will clear all the cached object, is it a problem?

      public Project getProjectDetail(Long projectid) {
       String sql = "select DISTINCT p from Project p";
       sql += " left join fetch p.pm";
       sql += " left join fetch p.dm";
       sql += " left join fetch p.tm";
       sql += " left join fetch p.customer";
       sql += " left join fetch p.moduleItems";
       sql += " left join fetch p.qaItems";
       sql += " left join fetch p.devItems";
       sql += " left join fetch p.phaseItems";
       sql += " where p.projectid = " + projectid;
       sql += " order by p.name";
       entityManager.clear();
       Project p = (Project)entityManager.createQuery(sql).getSingleResult();
       return p;
       }