Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Anyone?

like image 291
Kawu Avatar asked Dec 06 '10 15:12

Kawu


1 Answers

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
like image 156
kraftan Avatar answered Oct 22 '22 06:10

kraftan