开发者

JPA2 with MySQL backend: MyISAM or InnoDB

开发者 https://www.devze.com 2023-04-01 11:43 出处:网络
Obviously, there is plenty out there about MyISAM vs InnoDB engine selection, but I couldn\'t find anything specific to JPA2.

Obviously, there is plenty out there about MyISAM vs InnoDB engine selection, but I couldn't find anything specific to JPA2.

Is it possible to use a MyISAM engine together with java persistence API, and still have transaction support? Or does it rely on the RDBMS to provide rollback / commit functionality?

Are there other (non-obvious) factors that need to开发者_运维技巧 be considered? What about @Cascade?


I found this posting, which makes a pretty good case for using transactional RDBMS backends.

I managed to reproduce the behaviour:

  • Create an entity
  • Within the transaction, throw an Exception

With MyISAM, the entity will remain created. With InnoDB, the entity is created, but then rolled back. So even though I haven't been able to find something official, I am convinced that a transactional backend is required if one expects container-provided transactions to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消