Hibernate: what's the difference between MySQLDialect and MySQLInnoDBDialect?

前端 未结 1 1337
遇见更好的自我
遇见更好的自我 2021-01-04 06:13

What\'s the difference between MySQLDialect and MySQLInnoDBDialect? I\'ve used MySQLDialect ever since, now I wonder how the above are different.

Anyone?

相关标签:
1条回答
  • 2021-01-04 06:26

    The default storage engine in MySQL is MyISAM. If you need transactions and row-level locking, you often chose InnoDB.

    Using MySQLInnoDBDialect, Hibernate appends type=InnoDB to the table creation statement. This explicitly creates an InnoDB table. MySQLDialect does not append an engine string, thus, would create a MyISAM table.

    However, you can also change the default storage engine of the MySQL server by using the following line in your my.cnf, MySQL configuration, file.

    default-storage-engine=innodb
    
    0 讨论(0)
提交回复
热议问题