Persistence.createEntityManagerFactory() takes very long time to return

前端 未结 1 1927
遥遥无期
遥遥无期 2021-01-05 03:51

I am using Hibernate 4.2, JPA 2.0 & Postgres 9.2

The code gets stuck at Persistence.createEntityManagerFactory(\"peristence_unit_name\");

O

相关标签:
1条回答
  • 2021-01-05 04:23

    I have the same problem and for some reason it takes long time to extract JDBC metadata for hibernate. You can just turn off using jsbc metadata for hibernate and it will become very fast. But remember that hibernate is not using jdbc metadata and will use some defaults instead.

    To try this out set hibernate.temp.use_jdbc_metadata_defaults to false.

     <prop key="hibernate.temp.use_jdbc_metadata_defaults">false</prop>
    
    0 讨论(0)
提交回复
热议问题