Setup version on entity class
@Column(name = "VERSION") @Version private int version;
}
entityManager.find(getActiveUsers.class, 1, LockModeType.OPTIMISTIC);
Asked
Active
Viewed 53 times
0

Rupesh Kumar
- 15
- 3
-
optimistic locking is most preferable as long as it doesn't acquire any locks on your table – WildDev Jul 13 '18 at 13:00
1 Answers
0
I was able to achieve optimistic lock using @version on my entity class. which approach is better?

Rupesh Kumar
- 15
- 3