mysql icon indicating copy to clipboard operation
mysql copied to clipboard

context cancellation closes the connection immediately, making it impossible to rollback the transaction

Open acwest opened this issue 3 months ago • 1 comments

If I have a transaction that has been started with BeginTx, rows are added to a table using insert statements, and then the context passed in to BeginTx is cancelled, the connection is closed immediately, making it impossible to roll back the transaction, and the rows are commited. The expected behaviour would be to automatically roll back an interrupted transaction, or at least allow the user to do so.

acwest avatar Oct 01 '25 18:10 acwest

Transaction is not committed until executing "commit". Connection close cause rollback, not commit.

methane avatar Oct 02 '25 06:10 methane