Record a spring boot build frame connection MySQL database Note Transaction does not rollback failure

Source: Internet
Author: User
Tags mysql version

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

  1. Check your MySQL version first, the MySQL 4.0 series is not supported before the transaction. SELECT VERSION ();
  2. Check which engines your database supports show engines;
  3. Query the current database by default engine show variables like '%storage_engine% ';
  4. Look at a table with what engine show create table table name;
  5. Methods for repairing the table's storage engine
    1. 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
    2. When you build the table, specify the CREATE TABLE T_user (ID int primary key,name varchar) Engine=innodb;

    3. Modify the ALTER TABLE name after the table is completed ENGINE = InnoDB;

    4. 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

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.