File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

Tomcat creates new threads without new request

 
deepa raj
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Dear Ranchers,

We have one servlet which is deployed in Tomcat 5.It will connect to DB and extract the records from the DB.Some times records count will be very high.When the records are more , the first request is running (it took some time to extract and load ), but at the same time , the new thread is again starting to extract the records.So two threads are running now. After some time , third thread is started automatically and it is kepp going.All are for only one request from the browser.We are very much sure that we are not refreshing the page.

is there any configuration need to set to stop the new threads creation for the same request ?

 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
It's generally not good practice to do things that can take a long time in the HttpRequest thread. For one thing, since there are only a finite number of threads in that pool, you risk having the server logjam on you.

You may not be automatically refreshing the page, but are you sure that the user isn't getting impatient when nothing comes back and re-clicking the Submit button?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
We're not kidding.

http://faq.javaranch.com/java/CarefullyChooseOneForum

Please don't keep repeating this question. It's causing mass confusion.

http://www.coderanch.com/t/463592/Servlets/java/Servlet-requests-are-created-automatically
 
deepa raj
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
S.thatz y , i have posted in in Tomcat Sections instead of there in servlets section. :-)
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
deepa raj wrote:S.thatz y ,


Please use real words

deepa raj wrote:
i have posted in in Tomcat Sections instead of there in servlets section. :-)


I am going to close this one since you already have been discussing this in the Servlets forum.
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic