6

我正在使用 Seam 并收到“并发调用对话”错误。这是什么意思?

我有一个需要 5 分钟才能处理的按钮。我在 2 分钟内收到此错误。将并发请求超时设置为 10 分钟似乎不起作用。有没有办法阻止所有其他请求,直到第一个请求完成?

4

3 回答 3

5

Seam 文档的第 6.9 节解释了在会话上下文中处理并发调用的策略。

于 2010-04-28T13:48:42.460 回答
1

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)

于 2010-08-28T23:01:30.457 回答
0

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/

于 2010-10-22T10:17:25.203 回答