views:

14

answers:

0

Environment:

  • Client: JavaME, CDC/Foundation 1.1 with JSR-172 client library. Service stubs created with Sun WTK 2.5.2.
  • Server: JBoss 3.2.8SP1 (don't ask, cannot be changed) with Axis2.war providing the webservices

Problem:

In the JavaME based program a background thread calls a webservice on the remote JBoss host. Depending on user interaction or timeouts that background thread might be interrupted (using Thread.interrupt()).

Usually this is not a problem, except for when there is an ongoing webservice call in progress - the client aborts before the server has sent the full response. The client then moves on as if the call had never happened (which is a valid state). I checked for some sort of abort method in the client stub that would try to signal the cancellation to the server, but unforunately there is none.

The server however does not notice that the client went away prematurely and flags some data as having been exported to the mobile device. In effect, the data is now "stuck in between", because the device does not have it, but the server believes it does and prevents further changes, until it receives word from the client - which will of course never come.

From my understanding of the network layer I would have expected the underlying transport mechanism to notice that, because the TCP SYN/ACK/FIN/whatever signalling would not complete as for a normal call, allowing the server side socket implementation to recognize that the produced values were not consumed by the client. Wouldn't I see an exception somewhere? I have gone through the log files on the server side, but could not find any indication of the Axis2 server side recognizing the problem.

I am aware that this would still not solve my problem in my server application code, because that exception would happen "outside" its realm, but still it would give me a point at which to start.

Am I completely off track here, or is this an unsolved problem (hoping for the former :-)).