Persistence.createEntityManagerFactory() takes very long time to return

前端 未结 1 1928
遥遥无期
遥遥无期 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.

     false
    

    0 讨论(0)
提交回复
热议问题