并发通话通话
我正在使用 Seam 并收到“并发呼叫对话”错误。这意味着什么?
我有一个需要 5 分钟才能处理的按钮。我在 2 分钟内收到此错误。将并发请求超时设置为 10 分钟似乎不起作用。有没有办法阻止所有其他请求,直到第一个请求完成?
I'm using Seam and getting a "Concurrent call to conversation" error. What does this mean?
I have a button that takes 5 min to process. I get this error within 2 minutes. Setting the concurrent-request-timeout to 10 min does not seem to work. Is there a way to block all other requests until the first one has completed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Seam 文档第 6.9 节 解释在对话环境中处理并发呼叫的策略。
Section 6.9 of the Seam documentation explains strategies for handling concurrent calls in a conversational context.
我不认为阻止如此长的操作的所有其他请求是个好主意,更好的方法是让它异步运行。
您可以在这里查看 http://achorniy .wordpress.com/2009/07/14/avoid-concurrent-call-to-conversation/ 但这是允许您在短时间内阻止其他请求的解决方案(当然它可以阻止它们很长一段时间,但这通常不是让用户等待此类请求的好方法)
您可以在此处查看一个很好的示例,了解如何组织 UI 以在后端与异步配合使用(请参阅 richfaces livedemo“Ajax 支持”推/拉示例)
don't think it's great idea to block all other request for SUCH long operation, much better approach is to have it to run asynchronously.
You can take a look here http://achorniy.wordpress.com/2009/07/14/avoid-concurrent-call-to-conversation/ but this is the solution to allow you to block other requests during the short period of time (of course it can block them for a long time but that's not good approach in general to make user to wait for such requests)
You can take a look here for a good example of how UI can be organized to work with async on backend (see richfaces livedemo "Ajax Support" Push/Pull examples)
这是解决方案 - 使用 richfaces ProgressBar,调用 Seam 异步方法来运行长进程,并将带有参数的 ProgressBean 传递给异步方法(它应该可以从您在 JSF 中使用的会话 bean 访问)并定期更新进度状态在长时间运行的任务中
这种方法在这里有详细解释 [在 Seam/Richfaces 中显示动态进程进度][1]
[1] http://achorniy.wordpress.com/2010/10/22/show-dynamic-process-progress-in-seam-richfaces/
Here is the solution - use richfaces progressBar, call the seam asynchronous method to run long-process and pass the ProgressBean with parameters to async-method(it should be accessible from yuor conversation bean which you use in JSF) and periodically update progress-status in long-running task
This approach is explained in details here [Show dynamic process progress in Seam/Richfaces][1]
[1] http://achorniy.wordpress.com/2010/10/22/show-dynamic-process-progress-in-seam-richfaces/