0

Is there any spec on what impact a connection failure has on a mutation statement if autocommit is on?

For example, if a client starts, in autocommit mode, a mutation that can take a long time and then goes away, is it defined whether this will or will not commit?

For various reasons, we don't have the ability to add a start transaction before the statement which I assume would automatically rollback if the connection failed before sending a commit.

I suspect the behavior is not defined but thought I'd ask.

Mostly wondering about mysql and pg.

1

It will automatically rollback.

But... If you do not catch the "go away", but automatically reconnect and proceed with the other statements in the transaction, you could have a mess -- whether it is autocommit or not.

So, always check for errors and take evasive action.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.