Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1;

    xiaoxiao2021-12-03  36

    1.简要错误信息

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

    org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException:

    2.原因

    当执行更新或删除数据库时,数据库中已不存在这条数据。

    3.这种情况举例

    如多个线程同时删除同一条数据时,其中一个线程查到数据后,执行删除(查询时数据还存在,但删除操作提交时,已被其他线程删除掉)

    转载请注明原文地址: https://ju.6miu.com/read-680064.html

    最新回复(0)