kelezyl 2014-04-05 06:08
浏览 1591

getHibernateTemplate().delete()删除记录是报错

SpingMVC+Hibernate删除某一条数据库不存在的记录的时候,就会报错误:
13:55:38.206 [http-8080-2] ERROR org.hibernate.jdbc.AbstractBatcher - Exception executing batch:
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85) ~[hibernate3.jar:3.6.10.Final]
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70) ~[hibernate3.jar:3.6.10.Final]
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90) ~[hibernate3.jar:3.6.10.Final]
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) ~[hibernate3.jar:3.6.10.Final]
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) [hibernate3.jar:3.6.10.Final]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268) [hibernate3.jar:3.6.10.Final]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:189) [hibernate3.jar:3.6.10.Final]

自己使用try——catch也没有用

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?