title: Upgrade To Hibernate 4.3.4 main method never terminates JVM not finish
body: <p>i have to upgrade from <code>Hibernate 4.2.3</code> to <code>Hibernate 4.3.4</code> to test some <code>JPA 2.1</code> Spec. i have only change this line of <code>code</code></p>
  
  <p>Previous line:</p>
  
  <pre><code>final org.hibernate.service.ServiceRegistry serviceRegistry = new org.hibernate.service.ServiceRegistryBuilder().applySettings(hibConfiguration.getProperties()).buildServiceRegistry();
  </code></pre>
  
  <p>new Added code line</p>
  
  <pre><code>final org.hibernate.service.ServiceRegistry serviceRegistry = new org.hibernate.boot.registry.StandardServiceRegistryBuilder().applySettings(hibConfiguration.getProperties()).build();
  </code></pre>
  
  <p>the problem i have a main method just for test some <code>Criteria API</code> but the <code>main method</code> never finish with the latest <code>Hibernate Version</code> i have retrieve the running threads and and with the latest version the threads are as follow.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>comparing with the previous version this thread is the new one.</p>
  
  <pre><code>[threadID:]11 [threadName:] pool-1-thread-1 [isDaemon:] false [isAlive:] true
  </code></pre>
  
  <p>is a not a daemon according to the spec.</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>i think this thread will not finish at least in 5 minutes.</p>
  
  <p><strong>the problem arises only creating the HibernateSessionFactory.</strong></p>
  
  <pre><code>public static void main(String[] args)
  {        
      HibernateHandler handler = new HibernateHandler(true);//creates the HibernateSessionFactory
      return;//JVM not finish at this point
  }
  </code></pre>
  
  <p>i want my JVM terminates with the main method finish..</p>
  
  <p>what i am doing wrong..</p>