You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the handler code, you respond before committing the transaction in the middleware. What would happen if the tx.Commit() call returns an error?
The text was updated successfully, but these errors were encountered:
suppakorn-dev
changed the title
Respond before commit transaction
Question: Respond before commit transaction
May 2, 2024
Hmmmm. Right the handler will send the OK response, and then the middleware will unwind. There is a chance the Commit fails. In that case, the error middleware would log the error, the call to send a second response would happen, before closing the connection. Until we actually try it, I'm not 100% sure. I am going to try this now.
I have made changes to support the middleware rolling back and responding properly. It required changes to the web package and protocol layer code. The code is better for it.
Following the handler code, you respond before committing the transaction in the middleware. What would happen if the tx.Commit() call returns an error?
The text was updated successfully, but these errors were encountered: