Batch update returned unexpected row count from update [零]

Batch update returned unexpected row count from update [0]Batch update returned unexpected row coun

Batch update returned unexpected row count from update [0]

Batch update returned unexpected row count from update [0]; actual row count: 0;? expected: 1; nested exception is org.hibernate.StaleStateException:

一般为save方法与saveUpdate方法合为一起实现造成的,

以user对象为例:

当要save一个user的时候,user的id不为null,造成实质上是进行uodate操作,而此时数据库user表中的又没有id为此值的记录,所以就会报错