I tried adding @Version annotation to a long field to do versioning of my records with optimistic locking.
It fails each time when I try to create a new entity with this message
org.springframework.dao.OptimisticLockingFailureEx ception: Optimistic lock exception on saving entity: ........
Version # 1
As it is a new object
What am I doing wrong?
What other configuration is required?