Attached a runnable database independent testcase based on the given testcase. It shows that this exception still occurs in hibernate 5.