-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Ubuntu jpa hibernate problem
PostPosted: Thu Nov 27, 2008 1:17 pm 
Newbie

Joined: Thu Aug 11, 2005 12:15 am
Posts: 9
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 ...

Code:
    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(locations = "classpath:applicationContext.xml")
    @Transactional
    public class ArticleServiceTest {
     
       private Article article;
     
       @Autowired
       private ArticleService articleService;
     
       /**
        * Create test article before each test is run. Because of the
        * @Transaction annotation at the class level, the transaction should be rolled back after each class is run.
        */
       @Before
       public void createArticle() {
         
          List<Article> articlesToCreate = new ArrayList<Article>();
         
          article = new Article();
          article.setAuthor("Author");
     
          articlesToCreate.add(article);
          assertTrue(articleService.create(articlesToCreate) == 1);
          assertNotNull(article.getId());
    }
     
       @Test
       public void create() {
          Article a = articleService.getArticleById(article);
          assertNotNull(article.getId());
          assertSame(article, a);
       }
    }


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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.