I created a program using Hibernate.
The program reaches the main function end, nevertheless the program is running.
I wonder if it happens when Sessio
It seems that Hibernate 4.3.1 introduced a bug. I create the connection in my application with:
EntityManagerFactory connection = Persistence.createEntityManagerFactory(...)
but even if the createEntityManagerFactory method fails with an exception, the service registry remains open. However, as you could see from the above code, I cannot terminate my application because as the method didn't succeed the variable connection wasn't assigned (it is null), so I cannot call connection.close() that would destroy the service registry. It seems that this is really a bug, because how will I be able to release resources without resorting to a hack, like using specific Hibernate APIs from a JPA application?