I recently updated from java 8 to java 17 and Spring boot 2.7.6 to 3.0.7 and I get an error when I try to delete a row in a table using repo.deteleById(PK). I correctly retrieve my PK still get the below error while deleting:
Could not update row due to: org.springframework.orm.ObjectOptimisticLockingFailureException: batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
My entity has date variable called asofdate which is defined of type Instant and is also marked @Id. I correctly retrieve this PK record of asofdate but still face deletion issue. Is this because of any update? could you please help?
Comment From: wilkinsona
We can try to help, but we'll some more information to be able to do so. The first thing to note is that Spring Boot 3.0.x is no longer supported. Please upgrade to 3.1.8 or 3.2.2. If that does not help, please create a minimal example that reproduces your problem and share it with us. You can do so by zipping it up and attaching it to this issue or by pushing it to a separate repository on GitHub.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.