Recently I have been studying database transaction and one article quotes as following
JPA provide automatic support of row versioning via the @Version annotation.When you have entity with @Version annotatted field or property, optimistic locking will be enabled automatically.
My understanding is that database isolation level strategies are maintained using different locks like
- Read uncommitted: implemented with exclusive write-locks
- Read committed: implemented using shared read locks and exclusive write-locks.
so on. So, transactional isolation is implemented by different locking which I guess by using pessimistic locking.
My question is when a field is declared as @Version annotatted does it override the underlying default isolation level and optimistic locking take place ?