• 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

How to specify WebService operation timeout

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

I am working with JAX-WS webservices. We host some webservices on the JBoss 4.2.2 Application server. Since these webservices are hosted by me, I need to set the maximum amount of time that the webservice should be allowed to process. In case the processing takes up a lot of time, i need to rollback it. Can this be achieved by JAX-WS ? All that I find by googling it points me to a nice "executionTimeout" but that's in the .NET webservices.
If there is no such parameter, what is the default time that a calling webservice is allowed to wait (regardless of the timeout of that client) ?
Thanks for the time.


Cheers,
Rohit M.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rohit Macherla wrote:In case the processing takes up a lot of time, i need to rollback it.


Maybe you are trying to impose the timeout in the wrong place. For Example:
java.sql.Statement.setQueryTimeout(int)

All that I find by googling it points me to a nice "executionTimeout" but that's in the .NET webservices.


The HttpRuntimeSection.ExecutionTimeout Property seems to be a feature of the hosting ASP.NET platform (inherited from the ASP platform†) - not the web services framework.

(† Script/Request Timeout for JSP/Servlet?)
 
Rohit Macherla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peer Reynders,

Thanks for the reply.
Just a couple of questions :
So, does this mean that if my webservice goes into an infinite loop, or takes about 10hours to process, and , say the client that is invoking my webservice sets a timeout of 11hours, then everything would go fine ?(Supposing that all the other work that is done in the webservice doesn't timeout before that) I mean, I was thinking that there should be some configuration somewhere that should stop this. Please let me know if I am wrong.

Thanks.
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't used JBoss, but this will be a configuration in the JBoss Web Container thread pool. I have used this in Websphere. The default timeout is 60 seconds in Websphere. JBoss uses Tomcat. So, check the server.xml file.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rohit Macherla wrote:So, does this mean that if my webservice goes into an infinite loop, or takes about 10hours to process, and , say the client that is invoking my webservice sets a timeout of 11hours, then everything would go fine ?


It is unrealistic that a client would stick around that long (because of client-side timeouts) and the server side resources would still be tied up.

Tomcat doesn't seem to have a request, servlet or "whatever you want to call it" timeout that limits the execution time for servlets.

So the possibility of an indefinitely hung servlet seems to be very real. This is illustrated by a comment made in the mod_jk Apache Tomcat connector documentation.
The Apache Tomcat Connector - Timeouts HowTo Reply Timeout

If JK aborts waiting for a response, because a reply timeout fired, there is no way to stop processing on the backend. Although you free processing resources in your web server, the request will continue to run on the backend - without any way to send back a result once the reply timeout fired.



(Jetty at least gives you a maxIdleTime configuration parameter).
 
Rohit Macherla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peer Reynders,

Thanks a lot for your reply and your time.
We will rely on the client side timeout itself.
 
Squanch that. And squanch this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic