• Post Reply 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Interview question asked to me which I could not answer

 
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

Can we set request to be timedout? If so, where do we do it? Can we do it in web.xml declaratively or programatically in servelt? Or maybe in JSP? Need some help.

Thanks.
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your Web container is the one spawning new threads to service the request. So, it should be a configuration in your container to timeout the thread. For example, in Webshere you can configure the thread pool size and the timeouts.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Arulk for the reply. Can you tell me how to configure the thread pool size and the timeouts?
[ October 20, 2008: Message edited by: Arjun Reddy ]
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<session-config>
<session-timeout>120</session-timeout>
</session-config>


Thanks.
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So far I know in Tomcat, there is server.xml config file. You could find the connectors section to config the thread pool and timeout. Hope it will help you.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gopikrishna Madishetti:
<session-config>
<session-timeout>120</session-timeout>
</session-config>

That controls how long a session will be inactive before the container can invalidate it. The original question was "Can we set request to be timedout?" which has nothing to do with sessions.

I'm not sure what it would mean for a request to "time out". I wouldn't be surprised if a client (e.g. a browser) stopped waiting for a response after X seconds or minutes, but naturally that can't be controlled by the server in any way.
 
Sky Loi
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Paul. If the 'timeout' is meant in client side, you could define the timeout in client socket before you send request.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Really, jsp/servlets don't have this? What about the servlet containers?
Asp.Net has this and even PHP offers script execution timeout at the backend. So what this means is that a request could potentially hang continuously until the container is restarted?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic