Based on the @Autowire annotation, i guess you are using Spring. I don't have any experience in Spring. Looking at your code, i don't see any specific reason why the transaction should be rolled back. Can you please provide more details about you test case and why you are expecting the transaction to rollback?
It's a JPA thing ... unless entityManager.persist(article) is called, the transaction should not be committed. Under Windows it works correctly, under Ubuntu, the transaction is committed when it should not be.
posted 11 years ago
Eventually found the answer to the problem. It seems that on Windows I had MySQL set to use INNODB and on Ubuntu it was using MyISAM. MyISAM isn't transactional, therefore my rows weren't being rolled back.
Sorry to have blamed Ubuntu. (Now to get this Windows virus off my machine and reinstall Ubuntu)
get schwifty. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop