• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ubuntu jpa hibernate problem

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic