Possible fix: https://github.com/hibernate/hibernate-orm/pull/1968
PR doesn't cause any regressions locally.