I'm using a Webphere server. I am performing a file upload through a servlet using the Apache FileUpload methods.
I attach a listener to this FileUpload which updates a "percentage" field denoting what percentage of the request has been processed. The request gets directed to an iframe (form's target is an iframe) so that the page that fired the request doesn't have to wait for the response to complete and therefore it won't show the user just a blank page. I add a reference to the progress listener to the session as well.
From the JSP page as soon as I fire the submit on the form, after 1 second and then every second I fire an ajax request which goes to a servlet which looks up the ProgressListener and responds with the percentage field. The process works fine, but on Websphere sometimes this Ajax request can take up to 30 seconds to complete! I tested the same thing on a simple Tomcat server and there the request/response comes out within a second.
What could be wrong? Is it a server setting?
Thank you,
Edit: The code inside the servlet that gets the percentage from the session runs as soon as the request is made. The bottleneck seems to be in delivering the request back to the client browser.