How To End the Current Transaction

Q

How To End the Current Transaction? - MySQL FAQs - Transaction Management: Commit or Rollback

✍: FYIcenter.com

A

There are several ways the current transaction can be ended implicitly or explicitly:

  • In "Autocommit On" mode, a single-statement transaction will be ended implicitly when the execution of the statement ends. Changes will be committed.
  • Running the COMMIT command will explicitly end the current transaction. Changes will be committed.
  • Running the ROLLBACK command will explicitly end the current transaction. Changes will be rolled back.
  • Running the START TRANSACTION command will explicitly end the current transaction. Changes will be committed.
  • Running any DDL statement will implicitly end the current transaction. Changes will be committed.
  • Disconnecting a client session will implicitly end the current transaction. Changes will be rolled back.
  • Killing a client session will implicitly end the current transaction. Changes will be rolled back.

2007-05-11, 5225👍, 0💬