I am posting an adult article. Will it be deleted?
Problem Source
A small partner adds transaction commit to the method level. In addition, there are several operations to update the database table in the method. However, when the first few data items pass successfully, the last operation fails. According to General transaction management rules, transaction rollback should be triggered at the moment. However, it was not triggered. The first two operations were successfully written to the database, and the last operation ended.
Problem tracking
The project generally uses the MySQL database, and the management transaction is completed in spring. In fact, it has nothing to do with the development language. No matter what language or framework is used, such problems may occur. The following steps are analyzed respectively:
Check the source code and find no logical error
Compared with other methods, the service is abnormal.
So far, you have to doubt the database.
There is no exception in viewing database configurations, including InnoDB and UTF-8 encoding.
The engine used in the error table is MyISAM, which is different from other tables.
Conclusion
MySQL provides two engines, InnoDB and MyISAM. You can see the differences between the two engines:
InnoDB supports transactions which is not supported by tables which use MyISAM storage engine.
InnoDB has row-level locking, Relational integrity I. e. Supports Foreign keys, which is not possible in MyISAM.
InnoDB's performance for high volume data cannot be beaten by any other storage engines available.
In addition, there is an analysis comparison and selection of the appropriate engine:
My ISAM InnoDBRequired full text Search Yes 5.6+Require Transactions Yesfrequent select queries Yes frequent insert,update,delete YesRow Locking (multi processing on single table) YesRelational base design Yes
What if I post an adult title?