I need to upgrade from Hibernate 4.2.3 to Hibernate 4.3.4 to test some JPA 2.1 Spec. I just changed this line of code
Previous line:
final org.hibernate.service.ServiceRegistry serviceRegistry = new org.hibernate.service.ServiceRegistryBuilder().applySettings(hibConfiguration.getProperties()).buildServiceRegistry();
new Added line of code
final org.hibernate.service.ServiceRegistry serviceRegistry = new org.hibernate.boot.registry.StandardServiceRegistryBuilder().applySettings(hibConfiguration.getProperties()).build();
The problem is, I have a main method for testing only the Criteria API , but the main method never ends with the latest Hibernate Version , I get the current streams, and with the latest version the streams follow below.
ThreadList: [threadID:]2 [threadName:] Reference Handler [isDaemon:] true [isAlive:] true [threadID:]3 [threadName:] Finalizer [isDaemon:] true [isAlive:] true [threadID:]4 [threadName:] Signal Dispatcher [isDaemon:] true [isAlive:] true [threadID:]5 [threadName:] Attach Listener [isDaemon:] true [isAlive:] true [threadID:]10 [threadName:] Abandoned connection cleanup thread [isDaemon:] true [isAlive:] true [threadID:]11 [threadName:] pool-1-thread-1 [isDaemon:] false [isAlive:] true [threadID:]1 [threadName:] main [isDaemon:] false [isAlive:] true
Compared to the previous version, this thread is new.
[threadID:]11 [threadName:] pool-1-thread-1 [isDaemon:] false [isAlive:] true
not demons by specification.
No, it is not. The virtual machine terminates if the last non-daemon thread has finished. It doesn't have to be the main thread.
I think this thread will not end in at least 5 minutes.
The problem only occurs when creating a HibernateSessionFactory.
public static void main(String[] args) { HibernateHandler handler = new HibernateHandler(true);
I want my JVM to complete with the completion of the main method.
what am I doing wrong.