java - hibernate 错误:- Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]

标签 java hibernate jpa entity

我有一个使用 hibernate 和 JPA 的 Maven Web 项目。执行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 记录时,我遇到了同样的异常。因此,请检查您正在更新/删除的记录是否确实存在于数据库中

关于java - hibernate 错误:- Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58338278/

相关文章:

mysql - 根据 MySQL 中的日期选择记录

oracle - JPA 2.0 Oracle DATE 时间为空

java - Jpa 条件计数

java - Android - 将值从 ListFragment 传递到另一个 ListFragment

java - 将 ArrayList<Integer> 存储为 TreeMap Java 中的键

java - ant 运行时出现 NoClassDefFoundError

java - 持久化JPA后获取UniqueID

java - JSoup $ 登录 id 标签

java - 没有 [javax.persistence.EntityManager] 类型的限定 bean

java - Hibernate 和 Oracle 11g 中的 SQLGrammarException