Search code examples
spring-bootspring-transactions

Transaction Rollback when rest caller dies and the Response Object can't be delivered


The following scenario: The user calls a rest service. The server works and takes some time (e. g. 10 seconds) The user dies. The server responds with 200, but no one receives the answer. What's happening: The server successfully completes its transaction.

In this case, can I get an exception if I can't get rid of my response code to roll back the transaction?

Thank you in advance for your suggestions.

Andreas


Solution

  • As explained in How to rollback a transaction if the POST response could not be delivered it is not possible.

    What you could do:

    1. check status of the operation in the client (the client that timed out could retry request).
    2. If you are not satisfied with the state of the request, you may issue another request to revert the request (of course you need to implement the retry and revert logic).