See also https://hibernate.onjira.com/browse/HV-721