I am still working on JFA's suggestion of how to use Grizzly's Comet
support to move file uploads to their own threads. Our application is
often used by an entire classroom at the same time and in a lab
exercise all of the students may attempt to upload larger multimedia
files over a slow link. We've definitely seen this consume our
available request processing threads in Glassfish.
I have mostly plumbed together the necessary pieces but am having
trouble making my code work reliably under Glassfish 2.1. Sometimes
it works perfectly, other times it encounters errors in the Coyote
request classes.
My annotated sources, a smaller project just to try to build a proof
of concept, are here:
http://bitbucketlabs.net/files/upload-comet.zip
Am I missing something necessary to reliably access a Coyote
HttpServletRequest implementation from a separate thread? The errors
also seem to multiply the more times I use the upload form. Am I not
closing out the CometHandler and the original request/response
correctly?
I'd very much like to be able to deploy a solution like this as it
avoids the potential problems of creating a custom file upload server
socket on a separate port.
Any help, either from Jean-Francois or anyone else on the list, is appreciated.
Thanks! Thomas