[jboss-user] [JBoss Seam] - Re: Nested conversations - potential bug in Manager.beginNes

wschwendt do-not-reply at jboss.com
Wed Jul 11 20:15:24 EDT 2007


"gavin.king at jboss.com" wrote : You can't end two conversations in a single request. That's not how the model works. @End simply says "at the end of the request, end the current conversation".

For error handling a typical idiom in pages.xml is:



  |  <exception class="javax.persistence.OptimisticLockException">
  |         <end-conversation/>
  |         <redirect view-id="/error.xhtml">
  |             <message>Another user changed the same data, please try again</message>
  |         </redirect>
  |     </exception>



Now imagine that the exeption was thrown when a nested conversation was in progress:    Then above idiom would only end the nested conversation  (???)

But wouldn't it make sense to end also the all parent conversations up to (inclusive) the top-level long-running conversation?

Assuming that nested conversations share the persistence context (EntityManager) with their parent conversation (is my understanding right or wrong here?),   wouldn't an exception, thrown while the nested conversation is in progress, lead to the situation that also the persistence context of the parent conversation gets cleared?

I could be totally wrong here, but if also the persistence context of the parent conversation gets cleared,  I think it would make sense to end also that parent conversation before redirecting to error.xhtml.

So something as follows would be nice (with a more meaningful attribute name than "transitive" however).


  | <exception class="javax.persistence.OptimisticLockException">
  |         <end-conversation transitive="true"/>  // end all conversations up to top-level long-running conversation (inclusive)
  |         <redirect view-id="/error.xhtml">
  |             <message>Another user changed the same data, please try again</message>
  |         </redirect>
  |     </exception>	

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

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



More information about the jboss-user mailing list