immudb
immudb copied to clipboard
Rollback after failed exec
Performing a Rollback after a failed SQLExec results in a no transaction found error
Coverage decreased (-0.006%) to 89.827% when pulling 6e9d7e1e706cf6231e911693919034864ec780ce on fix/transaction-rollback into aea8acc16f2e53abf5357d0fe94877122b6ba8a3 on master.
I solved this by only closing (Cancel) a transaction if it has been created within execPreparedStmts. I looked at how this was solved in QueryPreparedStmt.
The transaction also gets returned, otherwise tx.sqlTx would be set to nil in transaction.SQLExec (pkg/server/sessions/internal/transactions/transactions.go)







