I'm writing an action which updates hundreds of thousands of records in database, and pass the result to a JSP page using ActionMessage. Because the operation may take quite a long time, the session may time-out before the update finishes. The result page requires authentication, so the timed out session will cause the loss of authentication information and the result page will fail to display. Is there any solution to solve this problem, if I'm only possible to change the action itself (the result page will be used by some other actions so it will be hard to change)?
Struts 2 provides the ExecuteAndWaitInterceptor, which displays a wait page while the time-consuming operation runs on its own thread. I believe it is implemented by polling the server, so it should prevent the session from timing out.
Another solution I've seen is that the user's request returns a "we'll be in touch" page immediately and the time-consuming operation is executed in another process which emails the user when it completes.