There are cases which the schema generation takes very long time. It seems that creating the EntityManagerFactory
is very slow in cases where you have a lot of metadata in your databases. So I guess this is not only dedicated to the schema generation, it could be also a problem at runtime.
We had such an issue with Oracle and according to this post:
https://stackoverflow.com/questions/23969399/persistence-createentitymanagerfactory-takes-very-long-time-to-return
We can turn of the feature, that metadata will be read from the database by setting the property hibernate.temp.use_jdbc_metadata_defaults
to false
in persistence.xml
. A follow up error requires us to define the hibernate.dialect
to org.hibernate.dialect.Oracle12cDialect
.