This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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