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.  [ 2 posts ] 
Author Message
 Post subject: StaleStateException: Batch update returned unexpected row co
PostPosted: Thu May 13, 2010 4:43 pm 
Newbie

Joined: Wed Apr 14, 2010 4:33 pm
Posts: 8
Hello all,
I am having a problem with a StaleStateException and I don't understand why its being thrown. I have
Code:
....
public class TestHibernateProgramDAO extends AbstractDAOTester<Program>
{
......   
   @Test
   @Transactional
   @Rollback
   public void shouldDeleteSingleProgram()
   {
      
      Program p = expectedProgram.get(0);
      programDAO.delete(p);
      for(Program pg : programDAO.findAll())
      {
         if(pg.equals(p))
         {
            fail("Did not delete specified program");
         }
      }
   }
.......


I don't understand why the state goes stale after deleting the program?

If it helps here is my DAO code which does the delete
Code:
public abstract class HibernateAbstractDAO<T extends Object> implements AbstractDAO<T>
{
      ......
   public void delete(T t)
   {
      getSession().delete(t);
   }
}


Top
 Profile  
 
 Post subject: Re: StaleStateException: Batch update returned unexpected row co
PostPosted: Mon May 17, 2010 11:31 am 
Regular
Regular

Joined: Tue May 11, 2010 5:50 pm
Posts: 54
Location: Norman, Ok, U.S.A
Try commit or flushing the session


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

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.