When 2LC enabled, flush session and then refresh entity cause dirty read in another session / transaction

Description

Test case:

hibernate.properties

note: MVCC should be enabled in connection url

In fact, this issue does not only replicate for refresh only, but every time we evict from the cache and reload an uncommitted entry:

So, it must be addresses such that once an entry is locked, the locked is not released when the entry is evicted.

Environment

h2 with MVCC

Status

Assignee

Vlad Mihalcea

Reporter

Zhenlei Huang

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure