The mysql transaction rollback is invalid.

Source: Internet
Author: User

The mysql transaction rollback is invalid.

A strange thing happened to the Payment Service recently. When a transaction fails, you call rollback and find that only the last SQL statement is rolled back.

After a long time of development check, it was found that the network jitters caused the begin of the first link creation to be lost, and then re-connected to it and then changed to autocommit, in this case, the previous SQL statements do not have rollback.

Tudou@ B2C .xiaomi.com

You can only add a variable at begin to hit the timestamp of the application server to the mysql server. All subsequent operations will read the timestamp, which is consistent with the timestamp on the application server, OK. Otherwise, redo it. The efficiency is much lower, but the transaction is guaranteed.

Tudou@ B2C .xiaomi.com

Are there any good solutions for other students?


Php mysql transactions cannot be rolled back. rollback does not work.

In MYSQL, only data tables of the INNODB and BDB types can support transaction processing. Other data types are not supported.
You can check what engine your database uses.

Mysql transaction, why does rollback not work

Delete from
Submitted by default. You can set that mysql DDL statements are not automatically submitted.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.