Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Tomcat creates new threads without new request

 
Ranch Hand
Posts: 124
  • 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 ?

 
Saloon Keeper
Posts: 22017
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • 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
Posts: 22017
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • 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.

https://coderanch.com/t/463592/Servlets/java/Servlet-requests-are-created-automatically
 
deepa raj
Ranch Hand
Posts: 124
  • 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. :-)
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • 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.
 
"Don't believe every tiny ad you see on the internet. But this one is rock solid." - George Washington
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic