• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

How to avoid session time-out when performing time-consuming operation  RSS feed

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
Posts: 9559
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
how do I do my own kindle-like thing - without amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!