This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sarath Jonnalagadda
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
John Woo
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic