[jboss-user] [JBoss Seam] - Re: EntityQuery.refresh() doesn't clear the result list??

ASavitsky do-not-reply at jboss.com
Thu Jul 19 11:59:44 EDT 2007


Thanks for your help Gavin.

There's a manual flush right before the refresh() call:

public void save() {
  | em.persist(selectedAccount);
  | em.flush();
  | selectedAccount = null;
  | userAccounts.refresh();
  | }

and the data does indeed get into the database. Here's the same log, this time with SQL logging included:

WARN  [org.jboss.seam.framework.EntityQuery] - before em.persist()  
  | Hibernate: select SEQ_ACCOUNT.nextval from dual
  | WARN  [org.jboss.seam.framework.EntityQuery] - before em.flush()  
  | Hibernate: insert into Account (CREATED_BY, CREATED_ON, MODIFIED_BY, MODIFIED_ON, ACCOUNT_NUMBER, closed, DEALER_NAME, discretionary, FAMILY_EXEMPTION, NAME_ON_STATEMENT, USER_ID, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  | Hibernate: update USERS set MODIFIED_BY=?, MODIFIED_ON=?, BLACKOUT_WINDOW=?, BUSINESS_UNIT=?, COVERAGE_REASON=?, DEPARTURE_DATE=?, email=?, FULL_NAME=?, MANAGER_EMAIL=?, MANAGER_NAME=?, role=?, START_DATE=?, status=?, TEMPLATE_ID=?, title=?, username=? where id=? and MODIFIED_ON=?
  | WARN  [org.jboss.seam.framework.EntityQuery] - before refresh()  
  | WARN  [org.jboss.seam.framework.EntityQuery] - Entered refresh(), ejbql FROM Account WHERE closed = false AND familyExemption = false AND user = #{principal}, hashcode 10610605, list size 5  
  | WARN  [org.jboss.seam.framework.EntityQuery] - Exited refresh(), ejbql FROM Account WHERE closed = false AND familyExemption = false AND user = #{principal}, hashcode 10610605, list size null  
  | WARN  [org.jboss.seam.framework.EntityQuery] - after refresh()  
  | Where's the SQL select that refreshes list?
  | WARN  [org.jboss.seam.framework.EntityQuery] - Entered getResultList(), ejbql FROM Account WHERE closed = false AND familyExemption = false AND user = #{principal}, hashcode 10610605, list size 5  
  | WARN  [org.jboss.seam.framework.EntityQuery] - Entered initResultList(), ejbql FROM Account WHERE closed = false AND familyExemption = false AND user = #{principal}, hashcode 10610605, list size 5  
  | 

But that's not even what baffles me. If resultList was set to null, it would have to be refreshed from the query. Now, where's the SELECT that refreshes the list? As you see, no SQL SELECT is logged between the places where resultList is null and where it's 5 items long again!

I'm suspecting that one of the interceptors resets the query state to what it was before the save() call - but again, it must be doing it in a way that my debugger doesn't catch. At least, the "variable modification" breakpoint in Eclipse doesn't catch that update.

I'll try it with the after transaction event, to see if it makes any difference, but still, it does look strange...

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

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



More information about the jboss-user mailing list