原文:异常:Batch update returned unexpected row count from update [0]; actual row count: 0;

使用了hibernate的主键生成策略,而在程序中又主动去设置了主键值。 lt class name ProductRegion table PRODUCT REGION lazy false gt lt id name id column PRODUCT REGION ID gt lt generator class native gt lt id gt lt many to one class ...

2017-09-16 16:33 0 1267 推荐指数:

查看详情

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

源代码 场景:平台的前台和后台为不同的用户登录,前台刷新页面的过程中,后台的页面刚好退出登录,拦截器在前台获取到了后台的用户信息,但此时后台用户信息在退出时已被删除,后台用户实体处于托管态。 异常分析:实体是托管态的时候,根据实体删除会报错。 修改后的代码 ...

Mon Nov 06 19:13:00 CST 2017 0 1687
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM