One of the services that is integrated into my app uses request cancellation. If this happens after the database transaction is closed, after the return response.json(...)
line from the controller, then the transaction is not rolled back.
How can I make the transaction to be completed only after a successful response to the client, or hang handler to cancel the request by the client?