[jboss-user] [JBoss Seam] - How can I disable the query cache?

chicochen do-not-reply at jboss.com
Sat Jul 28 22:43:40 EDT 2007


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;
  | 	}

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068501#4068501

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068501



More information about the jboss-user mailing list