Announcement Announcement Module
Collapse
No announcement yet.
StaleStateException: Batch update returned unexpected row count from update Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • StaleStateException: Batch update returned unexpected row count from update

    I'm having another problem with Spring and Hibernate in my JUnit tests.

    In an earlier thread I noted a misunderstanding I'm having with AbstractTransactionalDataSourceSpringContextTests:

    http://forum.springframework.org/showthread.php?t=21481

    As a workaround until I figure out the right answer, I decided to write my JUnit test in such a way that I create a instance, save it in the database, make sure that the number of instances has been incremented by one, delete it, make sure the number of instances has been decremented by one. Clever!

    But when I run the test, I get this Hibernate exception:

    org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1

    The REAL fix is to figure out what I've done wrong with the Spring class. But if I had to go this way, what would the fix be? Thanks.

    %
Working...
X