Implementing Optimistic lock using Hibernate and Spring
JPA/Hibernate Optmistic locking works by using some field to store the last modified version (e.g. timestamp, long) and then comparing the version of the entity in the session with the entity in the database to see if the change can be saved. For this to work you need to have a field in your entity … Read more