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.