Springboot – Hibernate – Postgres Pessimistic Locking not work
I am working on a project using Java 17.0.11, Spring Boot 3.1.1, Hibernate, and Postgres. I have a piece of code that has high concurrency requirements, and I used a pessimistic lock hoping to ensure that every time the function is called, it gets the most up-to-date data. Here is the code: