• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts forwarding to a 404 page in case of a long running transaction

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a problem. Currently we have an application which uploads data to a SFTP server. Depending on the data getting uploaded, the application can complete in few mint's or it can be a long running transaction. At, the end of the operation we will get a summary sheet page.

We receive the summary sheet, if the transaction is a short lived one. But in case of a long running transaction we get a 404 page instead of the summary page. We even tried to increase the session timeout to 20Hrs.. But no help.

It is an immediate requirement.
Thanks in Advance.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.

Originally posted by Sarath Jonnalagadda:
It is an immediate requirement.



First, Ease Up. Everyone's post here is "immediate", at least to them.
Next, it's a bad idea to use web server threads to perform long-running tasks. Web servers are designed to handle multiple short-lived HTTP communications, not hours-long batch jobs. Even if you make the session timeout huge, you still have to deal with other issues, like TCP/IP socket timeouts, firewall issues, browser timeouts and so on.
The typical solution in this case is to hand the long-running task off to another server designed for this task and let it run asynchronously. The HTTP request returns immediately. Either the user can be informed of the task completion with an email that contains a link to the results, or a waiting page can be displayed that refreshes at an interval. A task number stored in the session can be used to query the asynchronous task status.
[ September 19, 2008: Message edited by: Joe Ess ]
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, for such a long transaction, it is better to use asynchronous approach. You can use message queues to implement. Web applications are for synchronous transactions.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic