One and a half year later, same exception occurred to me.
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
I have a deadline to catch, and my code is all wrapped up in Spring and Maven, so no time to make a proper test case. But with the attached very simple use case reproduction of the bug will only cost a minute or two. Using hsqldb the code runs smoothly.
A quick look in my pom.xml shows the following relevant jars: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.3.7.Final</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.31</version> </dependency> <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>2.2.9</version> </dependency>
|