cockroach-go icon indicating copy to clipboard operation
cockroach-go copied to clipboard

User requested rollbacks

Open mbyio opened this issue 2 years ago • 0 comments

I have a use case where I want to a dry run of the transaction, and rollback right before returning. The docs are not very clear about the preferred way to achieve this. I decided to return my own error object that I can check for to know that it isn't a real error.

It would be nicer if this library defined a special ErrRollback value, and if it sees that value, rollback the transaction instead of committing, and then also don't return any error to the outer function. It would simplify the error handling code a bit.

mbyio avatar May 17 '23 03:05 mbyio