Spring JPA Transaction Manager does not rollback

后端 未结 1 2035
执念已碎
执念已碎 2021-01-29 00:18

I recently moved from Hibernate to JPA. Now I notice two things in my code.

  1. Methods in my services do not need @Transactional anymore to perform in

相关标签:
1条回答
  • 2021-01-29 00:39

    The issue was with table engine that's MyISAM. The transaction is able to rollback after I changed the engine to InnoDB.

    Setting the hibernate.dialect to org.hibernate.dialect.MySQLInnoDBDialect ensure the creation of table with InnoDBin the future.

    0 讨论(0)
提交回复
热议问题