Java 休眠错误:-托管刷新期间出错[批处理更新从更新[0]返回意外的行数;实际行数:0;应为:1]

Java 休眠错误:-托管刷新期间出错[批处理更新从更新[0]返回意外的行数;实际行数:0;应为:1],java,hibernate,jpa,entity,Java,Hibernate,Jpa,Entity,我有一个maven web项目,它使用hibernate和JPA。执行API时发生以下错误 org.hibernate.internal.ExceptionMapperStandardImpl.mapManagedFlushFailure : 39 HHH000346: Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; exp

我有一个maven web项目,它使用hibernate和JPA。执行API时发生以下错误

org.hibernate.internal.ExceptionMapperStandardImpl.mapManagedFlushFailure : 39
 HHH000346: Error during managed flush [Batch update returned unexpected row count from update [0];
 actual row count: 0; expected: 1]
系统一次执行多个API,但无法确定此错误的用例。
我尝试分别执行多个API来复制错误,但没有发生此错误。甚至堆栈跟踪也没有被打印。

我在删除一条完全不存在的Id记录时遇到了相同的异常。因此,请检查您正在更新/删除的记录是否确实存在于DB中。请发布您的代码片段,并检查您的事务边界