Row was updated or deleted by another transaction 异常原因及处理
来源:互联网 发布:军团要塞知乎 编辑:程序博客网 时间:2024/05/21 10:10
org.hibernate.StaleObjectStateException:
Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.xx.xx:11]
说明操作的对象时应用了乐观锁机制,或定义pojo时定义了version字段.
2:数据提交问题:
例如通过编辑页面来修改一条记录时:提交上来的form值对象中version为空或者大于数据库中对应该记录的version字段值,当update时,version不一致就会出错;
Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.xx.xx:11]
说明操作的对象时应用了乐观锁机制,或定义pojo时定义了version字段.
错误原因:
当在进行操作时,当前version版本与数据库中version版本不一致;
1:两个以上的session同时对此记录进行了相似操作;2:数据提交问题:
例如通过编辑页面来修改一条记录时:提交上来的form值对象中version为空或者大于数据库中对应该记录的version字段值,当update时,version不一致就会出错;
解决:
1.用form提交数据时,把version也一并提交上来;
2.从数据库中把version查出来,赋给实体对象;再更新; 0 0
- Row was updated or deleted by another transaction 异常原因及处理
- Row was updated or deleted by another transaction 异常原因及处理
- Row was updated or deleted by another transaction 异常原因及处理
- Row was updated or deleted by another transaction
- hibernate Row was updated or deleted by another transaction
- Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
- Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
- org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsav
- org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsav
- org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction
- 使用Hibernate时Row was updated or deleted by another transaction的解决方案
- org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorre
- hibernate异常 org.hibernate.StaleObjectStateException: Row was updated or deleted
- hibernate异常 org.hibernate.StaleObjectStateException: Row was updated or deleted .
- The row value(s) updated or deleted either do not make the row unique or they alter multiple rows.
- Repetitive Error: Updated by Another User (3,1)
- 异常处理:Null value was assigned to a property of primitive type setter of"原因及解决方案
- Was 突发异常处理
- 设计模式(一)--单例模式
- 电子书
- 2017-5-11 C++primer笔记
- 3.6 JS日期函数 Date()
- U-Boot中关于TEXT_BASE,代码重定位,链接地址相关说明
- Row was updated or deleted by another transaction 异常原因及处理
- 2016年蓝桥杯决赛 奇怪的数列
- MFC getforeignground window
- 观察者与委托
- 胡语录5.12
- vanishing gradient problem
- LINUX批处理文件的编写
- 小程序开发系列之基础部分-开发工具
- App Store审核被拒:App Store Review Guideline 2.5.2 and section 3.3.2 of the Apple Developer Program