Ways to End the Current Transaction in MySQL

Q

How To End the Current Transaction in MySQL?

✍: 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.

 

Transaction Management: Commit or Rollback in MySQL

⇒⇒MySQL Database Tutorials

2016-10-17, 228👍, 0💬