This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ubuntu jpa hibernate problem

 
mort sahl
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a problem (so what else is new!) and I'm not sure what's causing it.

I'm using Ubuntu 8.10 (same problem with 8.04), JPA with Hibernate as the provider and Spring 2.5.5. This problem does not exist when running the same code in windows.

I've a junit 4 test ...



The problem is, in Ubuntu, the article is not rolled back ... it should be.

In Windows, after the test is run, the article is rolled back.

Any ideas why I'm getting this behavior in Ubuntu?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
mort sahl
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
mort sahl
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic