| Author |
Max time of a thread in service method
|
Leandro Oliveira
Ranch Hand
Joined: Nov 07, 2002
Posts: 298
|
|
|
do anyone knows how long a thread can stay in service method? is there a max time in tomcat?
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
|
|
I think the problem is more frequently related to how long the browser will try to keep the connection open, not the limit in Tomcat. However you might check the connectionTimeout in the server.xml Connector element. <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" [ March 13, 2004: Message edited by: William Brogden ]
|
Java Resources at www.wbrogden.com
|
 |
Leandro Oliveira
Ranch Hand
Joined: Nov 07, 2002
Posts: 298
|
|
|
I'm facing a really bad problem! some times a thread spends too much time in a servie method (some times in a synchronized block) this blocks other threads and the hole thing goes down! any advise? The cause of threads spending lots of time in the service method is because they try to use a data base resource allready blocked by some user (outside the aplication), that forgets to release this resource!
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
|
|
There have been a number of related discussions in the servlet forum about requests that take a long time. You could probably find them by searching. Generally, the conclusion is that you should start a separate Thread in a Runnable object that tries to perform the time-consuming operation, while the request/response Thread writes something reasonable back to the client. Naturally you keep a reference to the worker class in the session so that subsequent requests can look to see how well it is doing.
|
 |
 |
|
|
subject: Max time of a thread in service method
|
|
|