title: Persistence.createEntityManager() painfully slow with Hibernate
body: <p>I'm having huge performance issues with my Eclipse RCP application, apparently caused by Hibernate. To be more specific, the application takes extremely long to start up (up to 2 minutes) - profiling and debugging showed that creating a Hibernate/JPA EntityManagerFactory (which happens at startup) takes extremely long. </p>
  
  <p>I've played around a lot with the settings, such as using a file database rather than in-memory and not using hbm2ddl, but without success. Has anyone ever experienced problems like these?</p>
  
  <p>I'm using JDK 1.6.20, Hibernate 3.5 and HSQLDB 1.8 (in-memory configuration).</p>
  
  <p>Below is my persistence.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
          http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
      version="2.0"&gt;
      &lt;persistence-unit name="my_db" transaction-type="RESOURCE_LOCAL"&gt;
          &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
              &lt;!-- about 20 classes; skipped for brevity --&gt;
          &lt;properties&gt;
              &lt;property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/&gt;
              &lt;property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/&gt;
              &lt;property name="hibernate.connection.url" value="jdbc:hsqldb:mem:my_db"/&gt;
              &lt;property name="hibernate.hbm2ddl.auto" value="create-drop"/&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;    
  &lt;/persistence&gt;
  </code></pre>