Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Tomcat creates new threads without new request

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?

 
Saloon Keeper
Posts: 28469
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 28469
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

https://coderanch.com/t/463592/Servlets/java/Servlet-requests-are-created-automatically
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
S.thatz y , i have posted in in Tomcat Sections instead of there in servlets section. :-)
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Hot dog! An advertiser loves us THIS much:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
    Bookmark Topic Watch Topic
  • New Topic