hibernate.connection.url is jdbc:derby:isolation;create=true and hibernate.connection.isolation is 2. I make two objects of HibernateExample7_IsolationRR_Thread, and i create a scenario where Thread 0 gets the vehicle and sleeps for long time. Meanwhile Thread 1 tries to get and update Vehicle. It successfully commits even before Thread 0 commits.
Due to the REPEATABLE_READ isolation level, shouldn't T1 wait on a commit. If not then it's a READ_COMMITED isolation level not a REPEATABLE_READ isolation level.
Your expectation is wrong. Repeatable read doesn't mean that a transaction should block while another transaction reads the same row. It means that reading the same row twice in the same transaction should return the same data, even if another transaction has committed a change to this row between the first and the second read.
You get that (more or less) for free with Hibernate, since the second read will return the data from the first-level cache, without going to the database at all.