What'll happen to a servlet request (including the transactions that have already been carried out) when:

Stuart Woodward

All of the above result in a "java.net.SocketException: Connection reset by peer: socket write error" when you close() the PrintWriter in the response. If it is important that the client see's the message then ideally you would want to catch the Exception and rollback the transaction you were working on.

In practice, with JSDK 2.0 it doesn't seem possible to trap this Exception. It seems like it is trapped at a lower level and a Stacktrace printed to the console which results in lots of garbage in the server logs. (Any corrections or advice about avoiding this is highly welcome).

As a result you really have no choice but to just process the result of a GET/POST to your Servlet regardless of whether the client actually recieves the response.

Sometimes an apparently cancelled request is the result of the client double clicking on a link so you may have to take precautions that this doesn't result in say two identical transactions being made.