Hibernate runs slowly on startup using schema authentication

I ran Spring-Boot with JPA and Postgres Database. Depending on my network environment, the initial phase is blocked for more than 15 seconds:

INFO  o.h.tool.hbm2ddl.SchemaValidator - HHH000229: Running schema validator

It is strange 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
+4
source share
3 answers

The circuit validator is just slow. We added this line to our spring configuration file for our environment profile "dev" (application-dev.properties)

spring.jpa.hibernate.ddl-auto=none

This is a bit risky since consistency between the database and JPA objects is not checked. But we have both test and QA environments that could solve any problems.

20 .

+1

(Yourkit ) , , . Yourkit ( ), .

, ( IDE, , IntelliJ ).

0

JPA (Eclipselink) Mysql , 1 , 4 .

:

create a table if it does not exist ... then it says that the error table already exists.

each journal entry above took about 15 seconds.

however, after searching, someone suggested using the latest Mysql connector driver (Jar file), I did it, and now it works fine.

so try using a different or newer jar connector file, in your case for postgresql it will be here

0
source

Source: https://habr.com/ru/post/1663159/


All Articles