I believe that what is happening is that the RequestStatement thread is not finishing by the time the HTTP thread, which the servlet code is running on is finishing and closing the connection.
In this case I don't see a reason to start the second thread because you would have to synchronize and wait for it to complete before returning from the servlets doXXX method anyway. It will also complicate error handling, redirection and including content should that ever become necessary.
Joined: Mar 21, 2011
Thanks Chris of your answer. You're right, i just put a join() on my thread and it works
subject: get "java.net.SocketException: socket closed", even if i am using HTTP connection