I've been running Spring-Boot with JPA and a Postgres Database. Depending on my network environment the starting phase is blocking for more than 15 sec on :
INFO o.h.tool.hbm2ddl.SchemaValidator - HHH000229: Running schema validator
The strange thing is that my Database is local. Any idea ?
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.hibernate.ddl-auto= validate
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/cine
The schema validator is just slow. We ended up adding this line to our spring configuration file for our "dev" environment profile (application-dev.properties)
spring.jpa.hibernate.ddl-auto=none
This is a bit risky, since the consistency between the database and JPA entities are not verified. But, we have both Test- and QA environments that would pick up any problems.
This fix did cut my startup process by about 20 seconds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With