Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAX-WS RI 2.1 where do I put timeout code?

 
John Landon
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a web service implemented with JAX-WS RI 2.1.
The service is RMI.
So when a client invokes a remote method. I send him response. Where do I put code that happens after the response was sent? Is there a timeout. So if the client died in the mean time I just reverse everything back as if the invocation never happened.

Thanks.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Landon wrote:Hi,
I have a web service implemented with JAX-WS RI 2.1.
The service is RMI.


:?: What does the binary Remote Method Invocation (RMI) protocol have to do with SOAP-based JAX-WS?

Where do I put code that happens after the response was sent? Is there a timeout. So if the client died in the mean time I just reverse everything back as if the invocation never happened.


Given that it is the hosting web server that is handling the HTTP response, JAX-WS on the server may not even have any knowledge of the fact that the client never finished receiving the response. But what kind of processing do you need to do that you need to "roll back" in case the client dies? It may be worth considering splitting the call into to phases: (1) initiation of processing returning a correlation ID and (2) retrieval of result with the correlation ID. That way the client can store the correlation ID outside of its process space (for later) in case the result retrieval fails and the server doesn't have to do the processing again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic