When I read a versioned entity in a transaction with a query that also sets the lock mode to optimistic explicitly, then hibernate tests the version when the read transaction commits to see if the version has changed.
This is what I expect of repeatable-read.
But if I don’t set a lock mode explicitly then hibernate doesn’t test the version on commit. Isn’t optimistic locking supposed to be default for a versioned entity?
(Hibernate 6.6)