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?
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
精彩评论