File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Tomcat creates new threads without new request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic
Author

Tomcat creates new threads without new request

deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
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

Joined: Jun 25, 2001
Posts: 16012
    
  19

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?


Customer surveys are for companies who didn't pay proper attention to begin with.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16012
    
  19

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

Joined: Jul 25, 2008
Posts: 124
S.thatz y , i have posted in in Tomcat Sections instead of there in servlets section. :-)
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10033
    
163

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.

[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat creates new threads without new request