[jboss-user] [JBoss Seam] - Hibernate can not execute query

vwiencek do-not-reply at jboss.com
Wed Oct 24 04:17:04 EDT 2007


Hi, 

is there a way to prevent an ajax request to call a method too much times ?

Indeed, I have an inputText with a search string and an ajax support calling a query() method on blur event. The problem occurs when the database contains too much data, and the query method is called too many times.

Is that possible to make this method synchronized ? or just ignore query() calls untill the last ended ?

my exception is : 

  | Caused by: org.hibernate.AssertionFailure: collection was processed twice by flush()
  |         at org.hibernate.engine.Collections.prepareCollectionForUpdate(Collections.java:202)
  |         at org.hibernate.engine.Collections.processReachableCollection(Collections.java:185)
  |         at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:37)
  |         at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)
  |         at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:61)
  |         at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
  |         at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:138)
  |         at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
  |         at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
  |         at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
  |         at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
  |         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
  |         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
  |         at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
  |         at com.gpec.PersonManagerAction.queryPersons(PersonManagerAction.java:67)
  | 

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

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



More information about the jboss-user mailing list