A new framework was built, using spring boot replacements to simplify the original cumbersome spring configuration, using spring annotations to manage transactions, and persistent layers using MyBatis.
Connection to MySQL database The process of completing the project was found not to support transactions, because the new framework used by itself is not very understanding, just beginning to think it is their own framework to build a problem,
Later found to be a problem with MySQL database engine
Solution Solutions
MyISAM does not support things, innodb support things
- Check your MySQL version first, the MySQL 4.0 series is not supported before the transaction. SELECT VERSION ();
- Check which engines your database supports show engines;
- Query the current database by default engine show variables like '%storage_engine% ';
- Look at a table with what engine show create table table name;
- Methods for repairing the table's storage engine
- Modify the configuration file my.cnf, in [mysqld] last added as DEFAULT-STORAGE-ENGINE=INNODB, restart the database service, the database default engine is modified to InnoDB
When you build the table, specify the CREATE TABLE T_user (ID int primary key,name varchar) Engine=innodb;
Modify the ALTER TABLE name after the table is completed ENGINE = InnoDB;
Batch build modification engine statements for a library, and execute the generated statements to
SELECT CONCAT (' ALTER TABLE ', table_name, ' engine=innodb; ') From Information_schema.tables WHERE table_schema= ' database name ' and engine= ' MyISAM ';
Related articles
Http://www.jb51.net/article/51481.htm
Record a spring boot build frame connection MySQL database Note Transaction does not rollback failure