I recently moved from Hibernate to JPA. Now I notice two things in my code.
Methods in my services do not need @Transactional anymore to perform in
@Transactional
The issue was with table engine that's MyISAM. The transaction is able to rollback after I changed the engine to InnoDB.
MyISAM
InnoDB
Setting the hibernate.dialect to org.hibernate.dialect.MySQLInnoDBDialect ensure the creation of table with InnoDBin the future.
hibernate.dialect
org.hibernate.dialect.MySQLInnoDBDialect