HttpURLConnection setChunkedStreamingMode() and SocketTimeoutException's
Hi All,
We have a WebSphere/Java application that uses a file management applet on client machines. We encountered a frustrating upload limit of about 40 MB and found that the applet was throwing an OutOfMemory error. We've come across the HTTPURLConnection setChunckedStreamingMode() method available in Jave 1.5 and are testing it out.
Our applet loops through a list of files and sends each one up to the server individually:
create and open a url connection
get output stream
send multipart post (multipart/form-data) (i.e. an individual file)
get inputstream and read success/failure result of attemtping to upload the file
In testing, the first file in the list always uploads successfully. We can now upload a file larger than 40 MB. However, the rest of the files in the list are sporadic - some succeed and others fail. For the files that fail, we see timeout exceptions:
org.apache.commons.fileupload.FileUploadException: Read timed out
caused by:
java.net.SocketTimeoutException: Read timed out
Interestingly, if we put the upload thread to sleep for 5 - 10 seconds in between uploading each file, the incidence of failures goes down, but is not eliminated. Has anyone come across this issue with setChunkedStreamingMode()? Any idea what's going on here or how to resolve it?

