| Can you try to reproduce it with our test case template: https://github.com/hibernate/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5 ? You will need to add a connection pool to the template to mimic your setup. It uses H2 as the default database. I would be surprised it's an ORM issue as we close and open a lot of session factories in our tests. But if you can reproduce it with our template then we'll consider it. Your code is not very safe AFAICS, no finally clauses, a lot of things potentially going wrong are not logged so it must be hard to know exactly what it is doing. |