Demo Project to demonstrate Hibernate Optimistic Lock with Spring Boot
Availale endpoint for this project are:
/{accountId}
/{accountId}/fast
/{accountId}/slow
Remove the try and catch from this part of code and then:
- Call the slow method with account id then
- Call the fast method with the same account id
After 10 second the slow method will throw StaleObjectStateException because of version mismatch.