JPA Batch update returned unexpected row count from update [0]; actual row count: 3; expected:1;问题解决

Problem Description:

Caused by: org.springframework.orm.jpa.JpaSystemException: Batch update returned unexpected row count from update [0]; actual row count: 3; expected: 1;

problem analysis:

1. When the saveAll() method is used, the primary key constraint is not set for the table, resulting in multiple records with the same id, resulting in an update error.

Solution: Delete the records with the same id, and ensure that there is only one record with an id.

Guess you like

Origin blog.csdn.net/qq_38974638/article/details/115196102