1 Reply Latest reply on Jan 11, 2010 3:22 PM by lpmon

    Entity updated due to AJAX action

    lpmon Novice

      Environment:

       

       

      JBoss5.1.0
      Seam2.2.0
      RichFaces3.3.2.SR1
      JSF1.2_12-b01-FCS

       

       

      On a page that is for editing a row in a database table and using EJB3 entity beans:

       

      There is an a4j:support tag (on a selectOneMenu) that fires a refresh of another selectOneMenu when the first one is changed.  That refresh works as it is supposed to.   The problem is: when the first selectOneMenu is changed that change is persisted to the database.  I have confirmed none of our methods are being called to save that entity.  It looks like the AJAX/Seam framework is taking it upon itself to persist this entity.

       

      I am not sure where to start on fixing this.

       

      Also relevant: using Seam managed transactions

       

      For debugging I created an @PreUpdate anotated method in the entity and set a breakpoint so as to capture the stack of calls leading to this.

       

      Here is that stack trace:

       

       

      FCMUnit(Units).preUpd() line: 1441   
      NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]   
      NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39   
      DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25   
      Method.invoke(Object, Object...) line: 597   
      BeanCallback.invoke(Object) line: 23   
      EntityCallbackHandler.callback(Callback[], Object) line: 80   
      EntityCallbackHandler.preUpdate(Object) line: 65   
      EJB3FlushEntityEventListener.invokeInterceptor(SessionImplementor, Object, EntityEntry, Object[], EntityPersister) line: 41   
      EJB3FlushEntityEventListener(DefaultFlushEntityEventListener).handleInterception(FlushEntityEvent) line: 330   
      EJB3FlushEntityEventListener(DefaultFlushEntityEventListener).scheduleUpdate(FlushEntityEvent) line: 270   
      EJB3FlushEntityEventListener(DefaultFlushEntityEventListener).onFlushEntity(FlushEntityEvent) line: 151   
      EJB3FlushEventListener(AbstractFlushingEventListener).flushEntities(FlushEvent) line: 219   
      EJB3FlushEventListener(AbstractFlushingEventListener).flushEverythingToExecutions(FlushEvent) line: 99   
      EJB3FlushEventListener(DefaultFlushEventListener).onFlush(FlushEvent) line: 49   
      SessionImpl.flush() line: 1027   
      SessionImpl.managedFlush() line: 365   
      AbstractEntityManagerImpl$1.beforeCompletion() line: 504   
      SynchronizationImple.beforeCompletion() line: 101   
      AtomicAction(TwoPhaseCoordinator).beforeCompletion() line: 269   
      AtomicAction(TwoPhaseCoordinator).end(boolean) line: 89   
      AtomicAction(AtomicAction).commit(boolean) line: 177   
      TransactionImple.commitAndDisassociate() line: 1423   
      TransactionManagerImple(BaseTransaction).commit() line: 137   
      TransactionManagerDelegate(BaseTransactionManagerDelegate).commit() line: 75   
      ServerVMClientUserTransaction.commit() line: 162   
      UTTransaction.commit() line: 52   
      SeamPhaseListener.commitOrRollback(String) line: 613   
      SeamPhaseListener.commitOrRollback(PhaseId) line: 604   
      SeamPhaseListener.handleTransactionsAfterPhase(PhaseEvent) line: 345   
      SeamPhaseListener.afterServletPhase(PhaseEvent) line: 245   
      SeamPhaseListener.afterPhase(PhaseEvent) line: 196   
      InvokeApplicationPhase(Phase).handleAfterPhase(FacesContext, ListIterator<PhaseListener>, PhaseEvent) line: 175   
      InvokeApplicationPhase(Phase).doPhase(FacesContext, Lifecycle, ListIterator<PhaseListener>) line: 114   
      LifecycleImpl.execute(FacesContext) line: 118   
      FacesServlet.service(ServletRequest, ServletResponse) line: 265   
      ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 290   
      ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206   
      Filter(BaseFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 530   
      ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235   
      ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 83   
      IdentityFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 40   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69   
      MultipartFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 90   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69   
      ExceptionFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 64   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69   
      RedirectFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 45   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69   
      ConfigurableXMLFilter(BaseXMLFilter).doXmlFilter(FilterChain, HttpServletRequest, HttpServletResponse) line: 178   
      Filter(BaseFilter).handleRequest(HttpServletRequest, HttpServletResponse, FilterChain) line: 290   
      Filter(BaseFilter).processUploadsAndHandleRequest(HttpServletRequest, HttpServletResponse, FilterChain) line: 388   
      Filter(BaseFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 515   
      Ajax4jsfFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 56   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69   
      LoggingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 60   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69   
      HotDeployFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 53   
      SeamFilter$FilterChainImpl.doFilter(ServletRequest, ServletResponse) line: 69   
      SeamFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 158   
      ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235   
      ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206   
      ReplyHeaderFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 96   
      ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235   
      ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206   
      StandardWrapperValve.invoke(Request, Response) line: 235   
      StandardContextValve.invoke(Request, Response) line: 191   
      SecurityAssociationValve.invoke(Request, Response) line: 190   
      NonLoginAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 433   
      JaccContextValve.invoke(Request, Response) line: 92   
      SecurityContextEstablishmentValve.process(Request, Response, HttpEvent) line: 126   
      SecurityContextEstablishmentValve.invoke(Request, Response) line: 70   
      StandardHostValve.invoke(Request, Response) line: 127   
      ErrorReportValve.invoke(Request, Response) line: 102   
      CachedConnectionValve.invoke(Request, Response) line: 158   
      StandardEngineValve.invoke(Request, Response) line: 109   
      CoyoteAdapter.service(Request, Response) line: 330   
      Http11Processor.process(Socket) line: 829   
      Http11Protocol$Http11ConnectionHandler.process(Socket) line: 598   
      JIoEndpoint$Worker.run() line: 447   
      Thread.run() line: 619