[jboss-user] [JBoss Seam] - Re: Stale Data until redeploy

sjmenden do-not-reply at jboss.com
Wed Oct 4 11:29:03 EDT 2006


So you are saying that one way to fix it is to do a refresh on all jobs in the job list?


  | public String view() {
  | 	Map parameters = new HashMap();
  | 	StringBuffer queryString = new StringBuffer();
  | 
  | 	queryString.append("from Job");
  | 	Query query = em.createQuery(queryString.toString());
  | 
  | 	jobs = (List<Job>) query.getResultList();
  | 	
  | 	//Refresh all of the jobs
  | 	for(int x = 0; x < jobs.size(); x++){
  | 		em.refresh(jobs.get(x));
  | 	}
  | 	return "viewJobs";
  | }
  | 

This does work to get the latest data, but isn't there a better way?  Now I am doing an additonal trip to the database for every job, there must be someway to force the retrieval of the new data each call NOT from cache?   Isn't this going to scale horrible when I get thousands of jobs?



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

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



More information about the jboss-user mailing list